From a4e49a1f52fedbead481f9230e7245c5c8059548 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Jul 2014 22:34:15 +0400 Subject: [PATCH] version 0.5.11, fixed links --- Telegram/PrepareLinux.sh | 4 ++-- Telegram/PrepareLinux32.sh | 4 ++-- Telegram/PrepareMac.sh | 4 ++-- Telegram/Setup.iss | 6 +++--- Telegram/SourceFiles/config.h | 5 +++-- Telegram/SourceFiles/gui/text.cpp | 14 +++++++++----- Telegram/SourceFiles/pspecific_wnd.cpp | 10 +++++----- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | Bin 5566 -> 5566 bytes Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ 10 files changed, 33 insertions(+), 28 deletions(-) diff --git a/Telegram/PrepareLinux.sh b/Telegram/PrepareLinux.sh index e1e0c3f92de1b2..4c4514f2bc6164 100755 --- a/Telegram/PrepareLinux.sh +++ b/Telegram/PrepareLinux.sh @@ -1,5 +1,5 @@ -AppVersionStr=0.5.10 -AppVersion=5010 +AppVersionStr=0.5.11 +AppVersion=5011 if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then echo "Deploy folder for version $AppVersionStr already exists!" diff --git a/Telegram/PrepareLinux32.sh b/Telegram/PrepareLinux32.sh index cf9fc4cfb99cf4..7afa796077851f 100755 --- a/Telegram/PrepareLinux32.sh +++ b/Telegram/PrepareLinux32.sh @@ -1,5 +1,5 @@ -AppVersionStr=0.5.10 -AppVersion=5010 +AppVersionStr=0.5.11 +AppVersion=5011 if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then echo "Deploy folder for version $AppVersionStr already exists!" diff --git a/Telegram/PrepareMac.sh b/Telegram/PrepareMac.sh index 4b1c7fcc859d98..6ea0dad9b651e5 100755 --- a/Telegram/PrepareMac.sh +++ b/Telegram/PrepareMac.sh @@ -1,5 +1,5 @@ -AppVersionStr=0.5.10 -AppVersion=5010 +AppVersionStr=0.5.11 +AppVersion=5011 if [ -d "./../Mac/Release/deploy/$AppVersionStr" ]; then echo "Deploy folder for version $AppVersionStr already exists!" diff --git a/Telegram/Setup.iss b/Telegram/Setup.iss index 1c91de999e4cfe..675df36ce3e017 100644 --- a/Telegram/Setup.iss +++ b/Telegram/Setup.iss @@ -3,9 +3,9 @@ #define MyAppShortName "Telegram" #define MyAppName "Telegram Win (Unofficial)" -#define MyAppVersion "0.5.10" -#define MyAppVersionZero "0.5.10" -#define MyAppFullVersion "0.5.10.0" +#define MyAppVersion "0.5.11" +#define MyAppVersionZero "0.5.11" +#define MyAppFullVersion "0.5.11.0" #define MyAppPublisher "Telegram (Unofficial)" #define MyAppURL "https://tdesktop.com" #define MyAppExeName "Telegram.exe" diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index ca44939cdbf669..4d022aae6d3715 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,14 +17,15 @@ Copyright (c) 2014 John Preston, https://tdesktop.com */ #pragma once -static const int32 AppVersion = 5010; -static const wchar_t *AppVersionStr = L"0.5.10"; +static const int32 AppVersion = 5011; +static const wchar_t *AppVersionStr = L"0.5.11"; #ifdef Q_OS_WIN static const wchar_t *AppName = L"Telegram Win (Unofficial)"; #else static const wchar_t *AppName = L"Telegram Desktop"; #endif static const wchar_t *AppId = L"{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"; +static const wchar_t *AppFile = L"Telegram"; #include "settings.h" diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 69089b667d9054..c221e8362fc961 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -111,8 +111,8 @@ namespace { return false; } - const QRegularExpression reDomain(QString::fromUtf8("(?|'\"\\[\\]\\{\\}`\\~\\!\\%\\^\\*\\(\\)\\-\\+=\\x10])#[A-Za-z_\\.0-9]{4,20}([\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\%\\^\\*\\(\\)\\-\\+=\\x10]|$)")); @@ -387,7 +387,7 @@ class TextParser { link.from = start + domainOffset; QStack parenth; - const QChar *p = start + mDomain.capturedEnd(); + const QChar *domainEnd = start + mDomain.capturedEnd(), *p = domainEnd; for (; p < end; ++p) { QChar ch(*p); if (chIsLinkEnd(ch)) break; // link finished @@ -413,7 +413,12 @@ class TextParser { } } } - + if (p > domainEnd) { // check, that domain ended + if (domainEnd->unicode() != '/') { + offset = domainEnd - start; + continue; + } + } link.len = p - link.from; } } @@ -2380,7 +2385,6 @@ void Text::setText(style::font font, const QString &text, const TextParseOptions if (!_textStyle) _initDefault(); _font = font; clean(); - { TextParser parser(this, text, options); } diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index e4561724eb7da9..6659da400cadd4 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2209,9 +2209,9 @@ void psExecTelegram() { if (cDebug()) targs += qsl(" -debug"); if (cDataFile() != (cTestMode() ? qsl("data_test") : qsl("data"))) targs += qsl(" -key \"") + cDataFile() + '"'; - QString telegram(QDir::toNativeSeparators(cExeDir() + "Telegram.exe")), wdir(QDir::toNativeSeparators(cWorkingDir())); + QString telegram(QDir::toNativeSeparators(cExeDir() + QString::fromWCharArray(AppFile) + qsl(".exe"))), wdir(QDir::toNativeSeparators(cWorkingDir())); - DEBUG_LOG(("Application Info: executing %1 %2").arg(cExeDir() + "Telegram.exe").arg(targs)); + DEBUG_LOG(("Application Info: executing %1 %2").arg(cExeDir() + QString::fromWCharArray(AppFile) + qsl(".exe")).arg(targs)); HINSTANCE r = ShellExecute(0, 0, telegram.toStdWString().c_str(), targs.toStdWString().c_str(), wdir.isEmpty() ? 0 : wdir.toStdWString().c_str(), SW_SHOWNORMAL); if (long(r) < 32) { DEBUG_LOG(("Application Error: failed to execute %1, working directory: '%2', result: %3").arg(telegram).arg(wdir).arg(long(r))); @@ -2222,14 +2222,14 @@ void _manageAppLnk(bool create, bool silent, int path_csidl, const wchar_t *args WCHAR startupFolder[MAX_PATH]; HRESULT hres = SHGetFolderPath(0, path_csidl, 0, SHGFP_TYPE_CURRENT, startupFolder); if (SUCCEEDED(hres)) { - QString lnk = QString::fromWCharArray(startupFolder) + "\\Telegram.lnk"; + QString lnk = QString::fromWCharArray(startupFolder) + '\\' + QString::fromWCharArray(AppFile) + qsl(".lnk"); if (create) { IShellLink* psl; hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&psl); if (SUCCEEDED(hres)) { IPersistFile* ppf; - QString exe = QDir::toNativeSeparators(QDir(cExeDir()).absolutePath() + "//Telegram.exe"), dir = QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()); + QString exe = QDir::toNativeSeparators(QDir(cExeDir()).absolutePath() + '/' + QString::fromWCharArray(AppFile) + qsl(".exe")), dir = QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()); psl->SetArguments(args); psl->SetPath(exe.toStdWString().c_str()); psl->SetWorkingDirectory(dir.toStdWString().c_str()); @@ -2264,7 +2264,7 @@ void psSendToMenu(bool send, bool silent) { } #ifdef _NEED_WIN_GENERATE_DUMP -static const WCHAR *_programName = L"Telegram Win (Unofficial)"; // folder in APPDATA, if current path is unavailable for writing +static const WCHAR *_programName = AppName; // folder in APPDATA, if current path is unavailable for writing static const WCHAR *_exeName = L"Telegram.exe"; LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter = 0; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 221faef6c0ec92..4dca2881be2b0c 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5.10 + 0.5.11 CFBundleSignature ???? NOTE diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 2a6d0b9a5021ca652acb116aa42585ca034a13c5..bb58d14548196ad3e75263776fd45a17c5281fb5 100644 GIT binary patch delta 58 zcmdm|y-$0C9yg=mWPNU9Rzn6I27}2Pxg|F@a2GKFxq3kETwdMHDtvN`aIW~~IQ|4S E0JWbE3IG5A delta 58 zcmdm|y-$0C9yg=GWPNU9Rs#kd27}2Pxg|F@a2GKFxq3kETwdMHDtvN`aIW~~IQ|4S E0JRnl1^@s6 diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 07bb55d41c9a9a..d9d60b5fac7476 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1453,7 +1453,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.5.10; + CURRENT_PROJECT_VERSION = 0.5.11; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1471,7 +1471,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.5.10; + CURRENT_PROJECT_VERSION = 0.5.11; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1495,9 +1495,9 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.5.10; + CURRENT_PROJECT_VERSION = 0.5.11; DYLIB_COMPATIBILITY_VERSION = 0.5; - DYLIB_CURRENT_VERSION = 0.5.10; + DYLIB_CURRENT_VERSION = 0.5.11; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; @@ -1620,10 +1620,10 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.5.10; + CURRENT_PROJECT_VERSION = 0.5.11; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.5; - DYLIB_CURRENT_VERSION = 0.5.10; + DYLIB_CURRENT_VERSION = 0.5.11; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0;