From 6188aea7ed5709a5a795d56a7e15221179481fd3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 10 May 2016 16:39:42 +0300 Subject: [PATCH] Beta version 9048001 for Xcode and QtCreator. --- Telegram/SourceFiles/core/basic_types.h | 6 ++-- .../SourceFiles/history/field_autocomplete.h | 2 +- Telegram/SourceFiles/historywidget.cpp | 3 +- Telegram/SourceFiles/pspecific_mac.cpp | 2 +- Telegram/SourceFiles/ui/flattextarea.cpp | 4 +-- Telegram/SourceFiles/ui/flattextarea.h | 2 ++ Telegram/Telegram.pro | 2 ++ Telegram/Telegram.xcodeproj/project.pbxproj | 30 ++++++++++++------- Telegram/Telegram.xcodeproj/qt_preprocess.mak | 6 ++++ 9 files changed, 39 insertions(+), 18 deletions(-) diff --git a/Telegram/SourceFiles/core/basic_types.h b/Telegram/SourceFiles/core/basic_types.h index d828ffd20..def3b712b 100644 --- a/Telegram/SourceFiles/core/basic_types.h +++ b/Telegram/SourceFiles/core/basic_types.h @@ -169,11 +169,11 @@ template char(&ArraySizeHelper(T(&array)[N]))[N]; // For QFlags<> declared in private section of a class we need to declare // operators from Q_DECLARE_OPERATORS_FOR_FLAGS as friend functions. #define Q_DECLARE_FRIEND_INCOMPATIBLE_FLAGS(Flags) \ -friend QIncompatibleFlag operator|(Flags::enum_type f1, int f2) Q_DECL_NOTHROW; +friend Q_DECL_CONSTEXPR QIncompatibleFlag operator|(Flags::enum_type f1, int f2) Q_DECL_NOTHROW; #define Q_DECLARE_FRIEND_OPERATORS_FOR_FLAGS(Flags) \ -friend QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) Q_DECL_NOTHROW; \ -friend QFlags operator|(Flags::enum_type f1, QFlags f2) Q_DECL_NOTHROW; \ +friend Q_DECL_CONSTEXPR QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) Q_DECL_NOTHROW; \ +friend Q_DECL_CONSTEXPR QFlags operator|(Flags::enum_type f1, QFlags f2) Q_DECL_NOTHROW; \ Q_DECLARE_FRIEND_INCOMPATIBLE_FLAGS(Flags) // using for_const instead of plain range-based for loop to ensure usage of const_iterator diff --git a/Telegram/SourceFiles/history/field_autocomplete.h b/Telegram/SourceFiles/history/field_autocomplete.h index b3ffaf58f..200a720fd 100644 --- a/Telegram/SourceFiles/history/field_autocomplete.h +++ b/Telegram/SourceFiles/history/field_autocomplete.h @@ -57,7 +57,7 @@ public: int32 innerTop(); int32 innerBottom(); - bool eventFilter(QObject *obj, QEvent *e); + bool eventFilter(QObject *obj, QEvent *e) override; enum class ChooseMethod { ByEnter, diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index e2ce96b1b..85a9ac085 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -5665,7 +5665,8 @@ void HistoryWidget::inlineBotResolveDone(const MTPcontacts_ResolvedPeer &result) UserData *resolvedBot = nullptr; if (result.type() == mtpc_contacts_resolvedPeer) { const auto &d(result.c_contacts_resolvedPeer()); - if (resolvedBot = App::feedUsers(d.vusers)) { + resolvedBot = App::feedUsers(d.vusers); + if (resolvedBot) { if (!resolvedBot->botInfo || resolvedBot->botInfo->inlinePlaceholder.isEmpty()) { resolvedBot = nullptr; } diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 6ebacc89f..7cac0e6c4 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -431,7 +431,7 @@ void PsMainWindow::psMacUpdateMenu() { canPaste = !Application::clipboard()->text().isEmpty(); } else if (FlatTextarea *edit = qobject_cast(focused)) { canCut = canCopy = canDelete = edit->textCursor().hasSelection(); - canSelectAll = !edit->getLastText().isEmpty(); + canSelectAll = !edit->isEmpty(); canUndo = edit->isUndoAvailable(); canRedo = edit->isRedoAvailable(); canPaste = !Application::clipboard()->text().isEmpty(); diff --git a/Telegram/SourceFiles/ui/flattextarea.cpp b/Telegram/SourceFiles/ui/flattextarea.cpp index e777fe49c..4d9431344 100644 --- a/Telegram/SourceFiles/ui/flattextarea.cpp +++ b/Telegram/SourceFiles/ui/flattextarea.cpp @@ -83,12 +83,12 @@ QString FlatTextarea::tagsMimeType() { } FlatTextarea::FlatTextarea(QWidget *parent, const style::flatTextarea &st, const QString &pholder, const QString &v, const TagList &tags) : QTextEdit(parent) -, _lastTextWithTags { v, tags } , _phVisible(!v.length()) , a_phLeft(_phVisible ? 0 : st.phShift) , a_phAlpha(_phVisible ? 1 : 0) , a_phColor(st.phColor->c) , _a_appearance(animation(this, &FlatTextarea::step_appearance)) +, _lastTextWithTags { v, tags } , _st(st) { setAcceptRichText(false); resize(_st.width, _st.font->height); @@ -821,7 +821,7 @@ void FlatTextarea::parseLinks() { // some code is duplicated in text.cpp! continue; } } - newLinks.push_back({ domainOffset - 1, p - start - domainOffset + 2 }); + newLinks.push_back({ domainOffset - 1, static_cast(p - start - domainOffset + 2) }); offset = matchOffset = p - start; } diff --git a/Telegram/SourceFiles/ui/flattextarea.h b/Telegram/SourceFiles/ui/flattextarea.h index 8315022ea..39f605bee 100644 --- a/Telegram/SourceFiles/ui/flattextarea.h +++ b/Telegram/SourceFiles/ui/flattextarea.h @@ -116,6 +116,8 @@ public: public: virtual QString mimeTagFromTag(const QString &tagId) = 0; virtual QString tagFromMimeTag(const QString &mimeTag) = 0; + virtual ~TagMimeProcessor() { + } }; void setTagMimeProcessor(std_::unique_ptr &&processor); diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 7973bc234..0094427a1 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -125,6 +125,7 @@ SOURCES += \ ./SourceFiles/dialogs/dialogs_indexed_list.cpp \ ./SourceFiles/dialogs/dialogs_layout.cpp \ ./SourceFiles/dialogs/dialogs_list.cpp \ + ./SourceFiles/history/field_autocomplete.cpp \ ./SourceFiles/inline_bots/inline_bot_layout_internal.cpp \ ./SourceFiles/inline_bots/inline_bot_layout_item.cpp \ ./SourceFiles/inline_bots/inline_bot_result.cpp \ @@ -248,6 +249,7 @@ HEADERS += \ ./SourceFiles/dialogs/dialogs_list.h \ ./SourceFiles/dialogs/dialogs_row.h \ ./SourceFiles/history/history_common.h \ + ./SourceFiles/history/field_autocomplete.h \ ./SourceFiles/inline_bots/inline_bot_layout_internal.h \ ./SourceFiles/inline_bots/inline_bot_layout_item.h \ ./SourceFiles/inline_bots/inline_bot_result.h \ diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 9bcf3780d..95a76cb28 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -75,6 +75,8 @@ 076B1C5B1CBFC8F1002C0BC2 /* top_bar_widget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 076B1C591CBFC8F1002C0BC2 /* top_bar_widget.cpp */; }; 076B1C5F1CBFC98F002C0BC2 /* overview_layout.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 076B1C5D1CBFC98F002C0BC2 /* overview_layout.cpp */; }; 076B1C631CBFCC53002C0BC2 /* moc_top_bar_widget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 076B1C621CBFCC53002C0BC2 /* moc_top_bar_widget.cpp */; }; + 076C51D41CE205120038F22A /* field_autocomplete.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 076C51D21CE205120038F22A /* field_autocomplete.cpp */; }; + 076C51D71CE2069F0038F22A /* moc_field_autocomplete.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 076C51D61CE2069F0038F22A /* moc_field_autocomplete.cpp */; }; 077A4AF71CA41C38002188D2 /* connection_abstract.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AEC1CA41C38002188D2 /* connection_abstract.cpp */; }; 077A4AF81CA41C38002188D2 /* connection_auto.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AEE1CA41C38002188D2 /* connection_auto.cpp */; }; 077A4AF91CA41C38002188D2 /* connection_http.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AF01CA41C38002188D2 /* connection_http.cpp */; }; @@ -396,6 +398,9 @@ 076B1C5D1CBFC98F002C0BC2 /* overview_layout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = overview_layout.cpp; path = SourceFiles/overview/overview_layout.cpp; sourceTree = SOURCE_ROOT; }; 076B1C5E1CBFC98F002C0BC2 /* overview_layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = overview_layout.h; path = SourceFiles/overview/overview_layout.h; sourceTree = SOURCE_ROOT; }; 076B1C621CBFCC53002C0BC2 /* moc_top_bar_widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_top_bar_widget.cpp; path = GeneratedFiles/Debug/moc_top_bar_widget.cpp; sourceTree = SOURCE_ROOT; }; + 076C51D21CE205120038F22A /* field_autocomplete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = field_autocomplete.cpp; path = SourceFiles/history/field_autocomplete.cpp; sourceTree = SOURCE_ROOT; }; + 076C51D31CE205120038F22A /* field_autocomplete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = field_autocomplete.h; path = SourceFiles/history/field_autocomplete.h; sourceTree = SOURCE_ROOT; }; + 076C51D61CE2069F0038F22A /* moc_field_autocomplete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_field_autocomplete.cpp; path = GeneratedFiles/Debug/moc_field_autocomplete.cpp; sourceTree = SOURCE_ROOT; }; 0771C4C94B623FC34BF62983 /* introwidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = introwidget.cpp; path = SourceFiles/intro/introwidget.cpp; sourceTree = ""; }; 077A4AEC1CA41C38002188D2 /* connection_abstract.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = connection_abstract.cpp; path = SourceFiles/mtproto/connection_abstract.cpp; sourceTree = SOURCE_ROOT; }; 077A4AED1CA41C38002188D2 /* connection_abstract.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = connection_abstract.h; path = SourceFiles/mtproto/connection_abstract.h; sourceTree = SOURCE_ROOT; }; @@ -884,6 +889,8 @@ 076B1C561CBFC8C9002C0BC2 /* history */ = { isa = PBXGroup; children = ( + 076C51D21CE205120038F22A /* field_autocomplete.cpp */, + 076C51D31CE205120038F22A /* field_autocomplete.h */, 076B1C571CBFC8D9002C0BC2 /* history_common.h */, ); name = history; @@ -1207,6 +1214,7 @@ 801973D3334D0FCA849CF485 /* Debug */ = { isa = PBXGroup; children = ( + 076C51D61CE2069F0038F22A /* moc_field_autocomplete.cpp */, 076B1C621CBFCC53002C0BC2 /* moc_top_bar_widget.cpp */, 07C8FE111CB80915007A8702 /* moc_toast_manager.cpp */, 077A4AFF1CA41EE2002188D2 /* moc_connection_abstract.cpp */, @@ -1675,6 +1683,7 @@ 77DA1217B595B799FB72CDDA /* flatinput.cpp in Compile Sources */, DE6A34CA3A5561888FA01AF1 /* flatlabel.cpp in Compile Sources */, 07C8FE041CB66D97007A8702 /* inline_bot_send_data.cpp in Compile Sources */, + 076C51D41CE205120038F22A /* field_autocomplete.cpp in Compile Sources */, 03270F718426CFE84729079E /* flattextarea.cpp in Compile Sources */, E3D7A5CA24541D5DB69D6606 /* images.cpp in Compile Sources */, ADE99904299B99EB6135E8D9 /* scrollarea.cpp in Compile Sources */, @@ -1771,6 +1780,7 @@ 07DE92AD1AA4928B00A18F6F /* moc_passcodebox.cpp in Compile Sources */, FCC949FEA178F9F5D7478027 /* moc_flattextarea.cpp in Compile Sources */, 07DB674D1AD07C9200A51329 /* abstractbox.cpp in Compile Sources */, + 076C51D71CE2069F0038F22A /* moc_field_autocomplete.cpp in Compile Sources */, 3F6EB1F5B98E704960FEA686 /* moc_scrollarea.cpp in Compile Sources */, 60CB4898955209B665E7B07D /* moc_twidget.cpp in Compile Sources */, 077A4B051CA41EE2002188D2 /* moc_connection_http.cpp in Compile Sources */, @@ -1903,11 +1913,13 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; + CRASHPAD_PATH = ./../../Libraries/crashpad/crashpad; CURRENT_PROJECT_VERSION = "$(TDESKTOP_VERSION)"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = "$(TDESKTOP_MAJOR_VERSION)"; DYLIB_CURRENT_VERSION = "$(TDESKTOP_VERSION)"; ENABLE_STRICT_OBJC_MSGSEND = YES; + FFMPEG_PATH = /usr/local; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; @@ -1940,6 +1952,7 @@ "$(CRASHPAD_PATH)", "$(CRASHPAD_PATH)/third_party/mini_chromium/mini_chromium", ); + ICONV_PATH = /usr/local; INFOPLIST_FILE = Telegram.plist; INSTALL_DIR = ./../Mac/Release/; LDPLUSPLUS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"; @@ -1954,6 +1967,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 10.8; OBJROOT = "./../Mac/$(CONFIGURATION)Intermediate"; + OPENAL_PATH = /usr/local; OTHER_CFLAGS = ( "-pipe", "-g", @@ -2015,15 +2029,11 @@ PRODUCT_NAME = Telegram; QT_LIBRARY_SUFFIX = ""; QT_PATH = "/usr/local/tdesktop/Qt-5.6.0"; - ZLIB_PATH = "/usr/local"; - FFMPEG_PATH = "/usr/local"; - ICONV_PATH = "/usr/local"; - CRASHPAD_PATH = "./../../Libraries/crashpad/crashpad"; - OPENAL_PATH = "/usr/local"; SDKROOT = macosx; SYMROOT = ./../Mac; TDESKTOP_MAJOR_VERSION = 0.9; TDESKTOP_VERSION = 0.9.48; + ZLIB_PATH = /usr/local; }; name = Release; }; @@ -2042,12 +2052,14 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; + CRASHPAD_PATH = ./../../Libraries/crashpad/crashpad; CURRENT_PROJECT_VERSION = "$(TDESKTOP_VERSION)"; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = "$(TDESKTOP_MAJOR_VERSION)"; DYLIB_CURRENT_VERSION = "$(TDESKTOP_VERSION)"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + FFMPEG_PATH = /usr/local; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; @@ -2080,6 +2092,7 @@ "$(CRASHPAD_PATH)", "$(CRASHPAD_PATH)/third_party/mini_chromium/mini_chromium", ); + ICONV_PATH = /usr/local; INFOPLIST_FILE = Telegram.plist; INSTALL_DIR = ./../Mac/Debug/; LDPLUSPLUS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"; @@ -2095,6 +2108,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; OBJROOT = "./../Mac/$(CONFIGURATION)Intermediate"; ONLY_ACTIVE_ARCH = YES; + OPENAL_PATH = /usr/local; OTHER_CFLAGS = ( "-pipe", "-g", @@ -2156,15 +2170,11 @@ PRODUCT_NAME = Telegram; QT_LIBRARY_SUFFIX = _debug; QT_PATH = "/usr/local/tdesktop/Qt-5.6.0"; - ZLIB_PATH = "/usr/local"; - FFMPEG_PATH = "/usr/local"; - ICONV_PATH = "/usr/local"; - CRASHPAD_PATH = "./../../Libraries/crashpad/crashpad"; - OPENAL_PATH = "/usr/local"; SDKROOT = macosx; SYMROOT = ./../Mac; TDESKTOP_MAJOR_VERSION = 0.9; TDESKTOP_VERSION = 0.9.48; + ZLIB_PATH = /usr/local; }; name = Debug; }; diff --git a/Telegram/Telegram.xcodeproj/qt_preprocess.mak b/Telegram/Telegram.xcodeproj/qt_preprocess.mak index 43332f3cb..8547fc00a 100644 --- a/Telegram/Telegram.xcodeproj/qt_preprocess.mak +++ b/Telegram/Telegram.xcodeproj/qt_preprocess.mak @@ -111,6 +111,7 @@ compilers: GeneratedFiles/qrc_telegram.cpp\ GeneratedFiles/Debug/moc_sessionsbox.cpp\ GeneratedFiles/Debug/moc_stickersetbox.cpp\ GeneratedFiles/Debug/moc_usernamebox.cpp\ + GeneratedFiles/Debug/moc_field_autocomplete.cpp\ GeneratedFiles/Debug/moc_introwidget.cpp\ GeneratedFiles/Debug/moc_introcode.cpp\ GeneratedFiles/Debug/moc_introphone.cpp\ @@ -237,6 +238,7 @@ compiler_moc_header_make_all: GeneratedFiles/Debug/moc_apiwrap.cpp\ GeneratedFiles/Debug/moc_sessionsbox.cpp\ GeneratedFiles/Debug/moc_stickersetbox.cpp\ GeneratedFiles/Debug/moc_usernamebox.cpp\ + GeneratedFiles/Debug/moc_field_autocomplete.cpp\ GeneratedFiles/Debug/moc_introwidget.cpp\ GeneratedFiles/Debug/moc_introcode.cpp\ GeneratedFiles/Debug/moc_introphone.cpp\ @@ -306,6 +308,7 @@ compiler_moc_header_clean: GeneratedFiles/Debug/moc_sessionsbox.cpp\ GeneratedFiles/Debug/moc_stickersetbox.cpp\ GeneratedFiles/Debug/moc_usernamebox.cpp\ + GeneratedFiles/Debug/moc_field_autocomplete.cpp\ GeneratedFiles/Debug/moc_introwidget.cpp\ GeneratedFiles/Debug/moc_introcode.cpp\ GeneratedFiles/Debug/moc_introphone.cpp\ @@ -498,6 +501,9 @@ GeneratedFiles/Debug/moc_stickersetbox.cpp: SourceFiles/boxes/stickersetbox.h GeneratedFiles/Debug/moc_usernamebox.cpp:SourceFiles/boxes/usernamebox.h $(MOC_FILE) SourceFiles/boxes/usernamebox.h -o GeneratedFiles/Debug/moc_usernamebox.cpp +GeneratedFiles/Debug/moc_field_autocomplete.cpp: SourceFiles/history/field_autocomplete.h + $(MOC_FILE) SourceFiles/history/field_autocomplete.h -o GeneratedFiles/Debug/moc_field_autocomplete.cpp + GeneratedFiles/Debug/moc_introwidget.cpp: SourceFiles/intro/introwidget.h $(MOC_FILE) SourceFiles/intro/introwidget.h -o GeneratedFiles/Debug/moc_introwidget.cpp