From e444373a4f92bbd33f86f7518b0653723269ccd1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Jul 2014 12:53:23 +0400 Subject: [PATCH] improved ubuntu build, added Updater --- Telegram/MetaEmoji.pro | 2 + Telegram/MetaLang.pro | 2 + Telegram/Packer.pro | 18 +- Telegram/SourceFiles/_other/genemoji.cpp | 1 - Telegram/SourceFiles/_other/updater_linux.cpp | 351 ++++++++++++++++++ Telegram/SourceFiles/app.cpp | 20 +- Telegram/SourceFiles/application.cpp | 3 +- Telegram/SourceFiles/boxes/emojibox.cpp | 2 +- Telegram/SourceFiles/pspecific_linux.cpp | 40 +- Telegram/Telegram.pro | 46 +-- Telegram/Updater.pro | 17 + Telegram/metaemoji_plugin_import.cpp | 13 - Telegram/packer_plugin_import.cpp | 13 - 13 files changed, 455 insertions(+), 73 deletions(-) create mode 100644 Telegram/SourceFiles/_other/updater_linux.cpp create mode 100644 Telegram/Updater.pro delete mode 100644 Telegram/metaemoji_plugin_import.cpp delete mode 100644 Telegram/packer_plugin_import.cpp diff --git a/Telegram/MetaEmoji.pro b/Telegram/MetaEmoji.pro index b897bc727f..dc0bc7e48e 100644 --- a/Telegram/MetaEmoji.pro +++ b/Telegram/MetaEmoji.pro @@ -12,6 +12,8 @@ CONFIG(release, debug|release) { DESTDIR = ./../ReleaseEmoji } +CONFIG += plugin static + macx { QMAKE_INFO_PLIST = ./SourceFiles/_other/Emoji.plist QMAKE_LFLAGS += -framework Cocoa diff --git a/Telegram/MetaLang.pro b/Telegram/MetaLang.pro index b5c77ad1b2..9fc6372ec9 100644 --- a/Telegram/MetaLang.pro +++ b/Telegram/MetaLang.pro @@ -12,6 +12,8 @@ CONFIG(release, debug|release) { DESTDIR = ./../ReleaseLang } +CONFIG += plugin static + macx { QMAKE_INFO_PLIST = ./SourceFiles/_other/Lang.plist QMAKE_LFLAGS += -framework Cocoa diff --git a/Telegram/Packer.pro b/Telegram/Packer.pro index 16082158fb..44ea38d901 100644 --- a/Telegram/Packer.pro +++ b/Telegram/Packer.pro @@ -2,14 +2,14 @@ QT += core CONFIG(debug, debug|release) { DEFINES += _DEBUG - OBJECTS_DIR = ./../Linux/DebugIntermediatePacker + OBJECTS_DIR = ./../DebugIntermediatePacker MOC_DIR = ./GeneratedFiles/Debug - DESTDIR = ./../Linux/DebugPacker + DESTDIR = ./../Debug } CONFIG(release, debug|release) { - OBJECTS_DIR = ./../Linux/ReleaseIntermediatePacker + OBJECTS_DIR = ./../ReleaseIntermediatePacker MOC_DIR = ./GeneratedFiles/Release - DESTDIR = ./../Linux/ReleasePacker + DESTDIR = ./../Release } macx { @@ -23,10 +23,10 @@ SOURCES += \ HEADERS += \ ./SourceFiles/_other/packer.h \ -INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.3.0/QtGui\ - ./../../Libraries/QtStatic/qtbase/include/QtCore/5.3.0/QtCore\ +INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.3.1/QtGui\ + ./../../Libraries/QtStatic/qtbase/include/QtCore/5.3.1/QtCore\ ./../../Libraries/QtStatic/qtbase/include\ - ./../../Libraries/lzma/C - -LIBS += -lcrypto -lssl -lz + ./../../Libraries/lzma/C\ + /usr/local/ssl/include +LIBS += -L/usr/local/ssl/lib -lcrypto -lssl -lz -llzma diff --git a/Telegram/SourceFiles/_other/genemoji.cpp b/Telegram/SourceFiles/_other/genemoji.cpp index 1ff8d796a1..566c2849aa 100644 --- a/Telegram/SourceFiles/_other/genemoji.cpp +++ b/Telegram/SourceFiles/_other/genemoji.cpp @@ -1058,7 +1058,6 @@ bool genEmoji(QString emoji_in, const QString &emoji_out, const QString &emoji_p } } QString postfix = variantPostfix[variantIndex], emojif = emoji_png + postfix + ".png"; - const char *tmp = emojif.toUtf8().constData(); QByteArray emojib; { QBuffer ebuf(&emojib); diff --git a/Telegram/SourceFiles/_other/updater_linux.cpp b/Telegram/SourceFiles/_other/updater_linux.cpp new file mode 100644 index 0000000000..17644207f6 --- /dev/null +++ b/Telegram/SourceFiles/_other/updater_linux.cpp @@ -0,0 +1,351 @@ +/* +This file is part of Telegram Desktop, +an unofficial desktop messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014 John Preston, https://tdesktop.com +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using std::string; +using std::deque; +using std::cout; + +bool copyFile(const char *from, const char *to) { + FILE *ffrom = fopen(from, "rb"), *fto = fopen(to, "wb"); + if (!ffrom) { + if (fto) fclose(fto); + return false; + } + if (!fto) { + fclose(ffrom); + return false; + } + static const int BufSize = 65536; + char buf[BufSize]; + while (size_t size = fread(buf, 1, BufSize, ffrom)) { + fwrite(buf, 1, size, fto); + } + + struct stat fst; // from http://stackoverflow.com/questions/5486774/keeping-fileowner-and-permissions-after-copying-file-in-c + //let's say this wont fail since you already worked OK on that fp + if (fstat(fileno(ffrom), &fst) != 0) { + fclose(ffrom); + fclose(fto); + return false; + } + //update to the same uid/gid + if (fchown(fileno(fto), fst.st_uid, fst.st_gid) != 0) { + fclose(ffrom); + fclose(fto); + return false; + } + //update the permissions + if (fchmod(fileno(fto), fst.st_mode) != 0) { + fclose(ffrom); + fclose(fto); + return false; + } + + fclose(ffrom); + fclose(fto); + + return true; +} + +bool remove_directory(const string &path) { // from http://stackoverflow.com/questions/2256945/removing-a-non-empty-directory-programmatically-in-c-or-c + DIR *d = opendir(path.c_str()); + if (!d) return false; + + while (struct dirent *p = readdir(d)) { + /* Skip the names "." and ".." as we don't want to recurse on them. */ + if (!strcmp(p->d_name, ".") || !strcmp(p->d_name, "..")) continue; + + string fname = path + '/' + p->d_name; + struct stat statbuf; + if (stat(fname.c_str(), &statbuf) != 0) { + if (S_ISDIR(statbuf.st_mode)) { + if (remove_directory(fname.c_str())) { + closedir(d); + return false; + } + } else { + if (unlink(fname.c_str())) { + closedir(d); + return false; + } + } + } + } + closedir(d); + + return !rmdir(path.c_str()); +} + +bool do_mkdir(const char *path) { // from http://stackoverflow.com/questions/675039/how-can-i-create-directory-tree-in-c-linux + struct stat statbuf; + if (stat(path, &statbuf) != 0) { + /* Directory does not exist. EEXIST for race condition */ + if (mkdir(path, S_IRWXU) != 0 && errno != EEXIST) return false; + } else if (!S_ISDIR(statbuf.st_mode)) { + errno = ENOTDIR; + return false; + } + + return true; +} + +bool mkpath(const char *path) { + int status = 0, pathsize = strlen(path) + 1; + char *copypath = new char[pathsize]; + memcpy(copypath, path, pathsize); + + char *pp = copypath, *sp; + while (status == 0 && (sp = strchr(pp, '/')) != 0) { + if (sp != pp) { + /* Neither root nor double slash in path */ + *sp = '\0'; + if (!do_mkdir(copypath)) { + delete[] copypath; + return false; + } + *sp = '/'; + } + pp = sp + 1; + } + delete[] copypath; + return do_mkdir(path); +} + +bool _debug = false; + +string exeName, exeDir; + +bool equal(string a, string b) { + std::transform(a.begin(), a.end(), a.begin(), ::tolower); + std::transform(b.begin(), b.end(), b.begin(), ::tolower); + return a == b; +} + +FILE *_logFile = 0; +void openLog() { + if (!_debug || _logFile) return; + + if (!do_mkdir("DebugLogs")) { + return; + } + + time_t timer; + + time(&timer); + struct tm *t = localtime(&timer); + + static const int maxFileLen = 65536; + char logName[maxFileLen]; + sprintf(logName, "DebugLogs/%04d%02d%02d_%02d%02d%02d_upd.txt", + t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); + _logFile = fopen(logName, "w"); +} + +void closeLog() { + if (!_logFile) return; + + fclose(_logFile); + _logFile = 0; +} + +void writeLog(const char *format, ...) { + if (!_logFile) return; + + va_list args; + va_start(args, format); + vfprintf(_logFile, format, args); + fprintf(_logFile, "\n"); + fflush(_logFile); + va_end(args); +} + +void delFolder() { + string delPath = "tupdates/ready", delFolder = "tupdates"; + writeLog("Fully clearing path '%s'..", delPath.c_str()); + if (!remove_directory(delPath)) { + writeLog("Error: failed to clear path! :("); + } + rmdir(delFolder.c_str()); +} + +bool update() { + writeLog("Update started.."); + + string updDir = "tupdates/ready"; + + deque dirs; + dirs.push_back(updDir); + + deque from, to, forcedirs; + + do { + string dir = dirs.front(); + dirs.pop_front(); + + string toDir = exeDir; + if (dir.size() > updDir.size() + 1) { + toDir += (dir.substr(updDir.size() + 1) + '/'); + forcedirs.push_back(toDir); + writeLog("Parsing dir '%s' in update tree..", toDir.c_str()); + } + + DIR *d = opendir(dir.c_str()); + if (!d) { + writeLog("Failed to open dir %s", dir.c_str()); + return false; + } + + while (struct dirent *p = readdir(d)) { + /* Skip the names "." and ".." as we don't want to recurse on them. */ + if (!strcmp(p->d_name, ".") || !strcmp(p->d_name, "..")) continue; + + string fname = dir + '/' + p->d_name; + struct stat statbuf; + if (!stat(fname.c_str(), &statbuf)) { + if (S_ISDIR(statbuf.st_mode)) { + dirs.push_back(fname); + writeLog("Added dir '%s' in update tree..", fname.c_str()); + } else { + string tofname = exeDir + fname.substr(updDir.size() + 1); + if (equal(tofname, exeName)) { // bad update - has Updater - delete all dir + writeLog("Error: bad update, has Updater! '%s' equal '%s'", tofname.c_str(), exeName.c_str()); + delFolder(); + return false; + } + from.push_back(fname); + to.push_back(tofname); + writeLog("Added file '%s' to be copied to '%s'", fname.c_str(), tofname.c_str()); + } + } else { + writeLog("Could not get stat() for file %s", fname.c_str()); + } + } + closedir(d); + } while (!dirs.empty()); + + for (size_t i = 0; i < forcedirs.size(); ++i) { + string forcedir = forcedirs[i]; + writeLog("Forcing dir '%s'..", forcedir.c_str()); + if (!forcedir.empty() && !mkpath(forcedir.c_str())) { + writeLog("Error: failed to create dir '%s'..", forcedir.c_str()); + delFolder(); + return false; + } + } + + for (size_t i = 0; i < from.size(); ++i) { + string fname = from[i], tofname = to[i]; + writeLog("Copying file '%s' to '%s'..", fname.c_str(), tofname.c_str()); + int copyTries = 0, triesLimit = 30; + do { + if (!copyFile(fname.c_str(), tofname.c_str())) { + ++copyTries; + usleep(100000); + } else { + break; + } + } while (copyTries < triesLimit); + if (copyTries == triesLimit) { + writeLog("Error: failed to copy, asking to retry.."); + delFolder(); + return false; + } + } + + writeLog("Update succeed! Clearing folder.."); + delFolder(); + return true; +} + +int main(int argc, char *argv[]) { + openLog(); + + writeLog("Updater started.."); + + bool needupdate = false, autostart = false, debug = false, tosettings = false; + char *key = 0; + for (int i = 1; i < argc; ++i) { + if (equal(argv[i], "-update")) { + needupdate = true; + } else if (equal(argv[i], "-autostart")) { + autostart = true; + } else if (equal(argv[i], "-debug")) { + debug = _debug = true; + openLog(); + } else if (equal(argv[i], "-tosettings")) { + tosettings = true; + } else if (equal(argv[i], "-key") && ++i < argc) { + key = argv[i]; + } + } + if (needupdate) writeLog("Need to update!"); + if (autostart) writeLog("From autostart!"); + + exeName = argv[0]; + writeLog("Exe name is: %s", exeName.c_str()); + if (exeName.size() >= 7) { + if (equal(exeName.substr(exeName.size() - 7), "Updater")) { + exeDir = exeName.substr(0, exeName.size() - 7); + writeLog("Exe dir is: %s", exeDir.c_str()); + if (needupdate) { + update(); + } + } else { + writeLog("Error: bad exe name!"); + } + } else { + writeLog("Error: short exe name!"); + } + + static const int MaxArgsCount = 128; + char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key"; + int argIndex = 0; + args[argIndex++] = p_noupdate; + if (autostart) args[argIndex++] = p_autostart; + if (debug) args[argIndex++] = p_debug; + if (tosettings) args[argIndex++] = p_tosettings; + if (key) { + args[argIndex++] = p_key; + args[argIndex++] = key; + } + + pid_t pid = fork(); + switch (pid) { + case -1: writeLog("fork() failed!"); return 1; + case 0: execv((exeDir + "Telegram").c_str(), args); return 1; + } + + writeLog("Executed Telegram, closing log and quiting.."); + closeLog(); + + return 0; +} diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index fb6c6274cf..acbe07ff39 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014 John Preston, https://tdesktop.com #include "application.h" #include "fileuploader.h" #include "mainwidget.h" -#include +//#include #include namespace { @@ -61,7 +61,7 @@ namespace { HistoryItem *hoveredItem = 0, *pressedItem = 0, *hoveredLinkItem = 0, *pressedLinkItem = 0, *contextItem = 0, *mousedItem = 0; - QSoundEffect *newMsgSound = 0; +// QSoundEffect *newMsgSound = 0; QPixmap *sprite = 0, *emojis = 0; typedef QMap EmojisMap; @@ -1222,11 +1222,11 @@ namespace App { void initMedia() { deinitMedia(false); - if (!newMsgSound) { - newMsgSound = new QSoundEffect(); - newMsgSound->setSource(QUrl::fromLocalFile(st::newMsgSound)); - newMsgSound->setVolume(1); - } +// if (!newMsgSound) { +// newMsgSound = new QSoundEffect(); +// newMsgSound->setSource(QUrl::fromLocalFile(st::newMsgSound)); +// newMsgSound->setVolume(1); +// } if (!::sprite) { ::sprite = new QPixmap(st::spriteFile); @@ -1251,9 +1251,9 @@ namespace App { if (completely) { LOG(("Deleting sound..")); - delete newMsgSound; +// delete newMsgSound; LOG(("Sound deleted!")); - newMsgSound = 0; +// newMsgSound = 0; delete ::sprite; ::sprite = 0; @@ -1344,7 +1344,7 @@ namespace App { } void playSound() { - if (cSoundNotify() && newMsgSound) newMsgSound->play(); +// if (cSoundNotify() && newMsgSound) newMsgSound->play(); } void writeConfig() { diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f570339d4e..2ad2a0aca6 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -143,7 +143,8 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv), } void Application::onAppUpdate(const MTPhelp_AppUpdate &response) { - updateRequestId = 0; + updateRequestId = 0; + cSetLastUpdateCheck(unixtime()); App::writeConfig(); if (response.type() == mtpc_help_noAppUpdate) { diff --git a/Telegram/SourceFiles/boxes/emojibox.cpp b/Telegram/SourceFiles/boxes/emojibox.cpp index 94a9ca0a0a..03d66305d0 100644 --- a/Telegram/SourceFiles/boxes/emojibox.cpp +++ b/Telegram/SourceFiles/boxes/emojibox.cpp @@ -98,7 +98,7 @@ void EmojiBox::fillBlocks() { for (uint32 i = 0; i < replacesCount; ++i) { Block block(getEmoji(replaces[i].code), QString::fromUtf8(replaces[i].replace)); currentRow.push_back(block); - if (int32(currentRow.size()) == replacesInRow) { + if (uint32(currentRow.size()) == replacesInRow) { _blocks.push_back(currentRow); currentRow.resize(0); } diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index ee630670d2..e19f4cd2f5 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -738,7 +738,7 @@ QString psCurrentExeDirectory(int argc, char *argv[]) { if (!first.isEmpty()) { QFileInfo info(first); if (info.exists()) { - QDir result(info.absolutePath() + qsl("/../../..")); + QDir result(info.absolutePath()); return result.absolutePath() + '/'; } } @@ -839,10 +839,13 @@ void psPostprocessFile(const QString &name) { } void psOpenFile(const QString &name, bool openWith) { + QDesktopServices::openUrl(QUrl::fromLocalFile(name)); //objc_openFile(name, openWith); } void psShowInFolder(const QString &name) { + QDesktopServices::openUrl(QFileInfo(name).absoluteDir().absolutePath()); +// system(("nautilus " + QFileInfo(name).absoluteDir().absolutePath()).toUtf8().constData()); //objc_showInFinder(name, QFileInfo(name).absolutePath()); } @@ -850,15 +853,46 @@ void psFinish() { //objc_finish(); } +bool _execUpdater(bool update = true) { + static const int MaxArgsCount = 128, MaxLen = 65536; + char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key"; + char p_datafile[MaxLen] = {0}; + int argIndex = 0; + if (!update) { + args[argIndex++] = p_noupdate; + args[argIndex++] = p_tosettings; + } + if (cFromAutoStart()) args[argIndex++] = p_autostart; + if (cDebug()) args[argIndex++] = p_debug; + if (cDataFile() != (cTestMode() ? qsl("data_test") : qsl("data"))) { + QByteArray dataf = cDataFile().toUtf8(); + if (dataf.size() < MaxLen) { + memcpy(p_datafile, dataf.constData(), dataf.size()); + args[argIndex++] = p_key; + args[argIndex++] = p_datafile; + } + } + char path[MaxLen] = {0}; + QByteArray data((cExeDir() + "Updater").toUtf8()); + memcpy(path, data.constData(), data.size()); + + pid_t pid = fork(); + switch (pid) { + case -1: return false; + case 0: execv(path, args); return false; + } + return true; +} + void psExecUpdater() { - if (true /*!objc_execUpdater()*/) { + if (!_execUpdater()) { QString readyPath = cWorkingDir() + qsl("tupdates/ready"); PsUpdateDownloader::deleteDir(readyPath); } } void psExecTelegram() { - //objc_execTelegram(); + _execUpdater(false); } void psAutoStart(bool start, bool silent) { diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index d3b1cb4a01..0a910a515d 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -1,19 +1,21 @@ -QT += core gui network multimedia widgets +QT += core gui network widgets +#QT += multimedia CONFIG += plugin static CONFIG(debug, debug|release) { DEFINES += _DEBUG - OBJECTS_DIR = ./../Linux/DebugIntermediate + OBJECTS_DIR = ./../DebugIntermediate MOC_DIR = ./GeneratedFiles/Debug RCC_DIR = ./GeneratedFiles - DESTDIR = ./../Linux/Debug + DESTDIR = ./../Debug } CONFIG(release, debug|release) { - OBJECTS_DIR = ./../Linux/ReleaseIntermediate + DEFINES += CUSTOM_API_ID + OBJECTS_DIR = ./../ReleaseIntermediate MOC_DIR = ./GeneratedFiles/Release RCC_DIR = ./GeneratedFiles - DESTDIR = ./../Linux/Release + DESTDIR = ./../Release } macx { @@ -28,30 +30,30 @@ linux { HEADERS += ./SourceFiles/pspecific_linux.h } -style_auto_cpp.target = ./GeneratedFiles/style_auto.cpp +style_auto_cpp.target = ./../../Telegram/GeneratedFiles/style_auto.cpp style_auto_cpp.depends = FORCE -style_auto_cpp.commands = ./../Linux/DebugStyle/MetaStyle -classes_in ./Resources/style_classes.txt -classes_out ./GeneratedFiles/style_classes.h -styles_in ./Resources/style.txt -styles_out ./GeneratedFiles/style_auto.h -path_to_sprites ./SourceFiles/art/ -style_auto_cpp.depends = ./Resources/style.txt ./Resources/style_classes.txt +style_auto_cpp.commands = ./../DebugStyle/MetaStyle -classes_in ./../../Telegram/Resources/style_classes.txt -classes_out ./../../Telegram/GeneratedFiles/style_classes.h -styles_in ./../../Telegram/Resources/style.txt -styles_out ./../../Telegram/GeneratedFiles/style_auto.h -path_to_sprites ./../../Telegram/SourceFiles/art/ +style_auto_cpp.depends = ./../../Telegram/Resources/style.txt ./../../Telegram/Resources/style_classes.txt -style_auto_h.target = ./GeneratedFiles/style_auto.h +style_auto_h.target = ./../../Telegram/GeneratedFiles/style_auto.h style_auto_h.depends = FORCE -style_auto_h.commands = ./../Linux/DebugStyle/MetaStyle -classes_in ./Resources/style_classes.txt -classes_out ./GeneratedFiles/style_classes.h -styles_in ./Resources/style.txt -styles_out ./GeneratedFiles/style_auto.h -path_to_sprites ./SourceFiles/art/ -style_auto_h.depends = ./Resources/style.txt ./Resources/style_classes.txt +style_auto_h.commands = ./../DebugStyle/MetaStyle -classes_in ./../../Telegram/Resources/style_classes.txt -classes_out ./../../Telegram/GeneratedFiles/style_classes.h -styles_in ./../../Telegram/Resources/style.txt -styles_out ./../../Telegram/GeneratedFiles/style_auto.h -path_to_sprites ./../../Telegram/SourceFiles/art/ +style_auto_h.depends = ./../../Telegram/Resources/style.txt ./../../Telegram/Resources/style_classes.txt -style_classes_h.target = ./GeneratedFiles/style_classes.h +style_classes_h.target = ./../../Telegram/GeneratedFiles/style_classes.h style_classes_h.depends = FORCE -style_classes_h.commands = ./../Linux/DebugStyle/MetaStyle -classes_in ./Resources/style_classes.txt -classes_out ./GeneratedFiles/style_classes.h -styles_in ./Resources/style.txt -styles_out ./GeneratedFiles/style_auto.h -path_to_sprites ./SourceFiles/art/ -style_classes_h.depends = ./Resources/style.txt ./Resources/style_classes.txt +style_classes_h.commands = ./../DebugStyle/MetaStyle -classes_in ./../../Telegram/Resources/style_classes.txt -classes_out ./../../Telegram/GeneratedFiles/style_classes.h -styles_in ./../../Telegram/Resources/style.txt -styles_out ./../../Telegram/GeneratedFiles/style_auto.h -path_to_sprites ./../../Telegram/SourceFiles/art/ +style_classes_h.depends = ./../../Telegram/Resources/style.txt ./../../Telegram/Resources/style_classes.txt -lang_cpp.target = ./GeneratedFiles/lang.cpp +lang_cpp.target = ./../../Telegram/GeneratedFiles/lang.cpp lang_cpp.depends = FORCE -lang_cpp.commands = ./../Linux/DebugLang/MetaLang -lang_in ./Resources/lang.txt -lang_out ./GeneratedFiles/lang -lang_cpp.depends = ./Resources/lang.txt +lang_cpp.commands = ./../DebugLang/MetaLang -lang_in ./../../Telegram/Resources/lang.txt -lang_out ./../../Telegram/GeneratedFiles/lang +lang_cpp.depends = ./../../Telegram/Resources/lang.txt -lang_h.target = ./GeneratedFiles/lang.h +lang_h.target = ./../../Telegram/GeneratedFiles/lang.h lang_h.depends = FORCE -lang_h.commands = ./../Linux/DebugLang/MetaLang -lang_in ./Resources/lang.txt -lang_out ./GeneratedFiles/lang -lang_h.depends = ./Resources/lang.txt +lang_h.commands = ./../DebugLang/MetaLang -lang_in ./../../Telegram/Resources/lang.txt -lang_out ./../../Telegram/GeneratedFiles/lang +lang_h.depends = ./../../Telegram/Resources/lang.txt hook.depends = style_auto_cpp style_auto_h style_classes_h lang_cpp lang_h CONFIG(debug,debug|release):hook.target = Makefile.Debug @@ -233,8 +235,8 @@ INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.3.1/QtGui\ ./../../Libraries/libexif-0.6.20\ /usr/local/ssl/include LIBS += -L/usr/local/ssl/lib -lcrypto -lssl -lz -ldl -llzma -LIBS += ./../../Libraries/libexif-0.6.20/libexif/.libs/libexif.a -LIBS += ./../../Libraries/QtStatic/qtmultimedia/plugins/audio/libqtmedia_pulse.a +LIBS += ./../../../Libraries/libexif-0.6.20/libexif/.libs/libexif.a +LIBS += ./../../../Libraries/QtStatic/qtmultimedia/plugins/audio/libqtmedia_pulse.a RESOURCES += \ ./SourceFiles/telegram.qrc diff --git a/Telegram/Updater.pro b/Telegram/Updater.pro new file mode 100644 index 0000000000..2d3764e3a7 --- /dev/null +++ b/Telegram/Updater.pro @@ -0,0 +1,17 @@ +TEMPLATE = app +CONFIG += console +CONFIG -= app_bundle +CONFIG -= qt + +SOURCES += ./SourceFiles/_other/updater_linux.cpp + +CONFIG(debug, debug|release) { + DEFINES += _DEBUG + OBJECTS_DIR = ./../DebugIntermediateUpdater + DESTDIR = ./../Debug +} +CONFIG(release, debug|release) { + DEFINES += CUSTOM_API_ID + OBJECTS_DIR = ./../ReleaseIntermediateUpdater + DESTDIR = ./../Release +} diff --git a/Telegram/metaemoji_plugin_import.cpp b/Telegram/metaemoji_plugin_import.cpp deleted file mode 100644 index 7c0d095425..0000000000 --- a/Telegram/metaemoji_plugin_import.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// This file is autogenerated by qmake. It imports static plugin classes for -// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS. variables. -#include -Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) -Q_IMPORT_PLUGIN(QDDSPlugin) -Q_IMPORT_PLUGIN(QICNSPlugin) -Q_IMPORT_PLUGIN(QICOPlugin) -Q_IMPORT_PLUGIN(QJp2Plugin) -Q_IMPORT_PLUGIN(QMngPlugin) -Q_IMPORT_PLUGIN(QTgaPlugin) -Q_IMPORT_PLUGIN(QTiffPlugin) -Q_IMPORT_PLUGIN(QWbmpPlugin) -Q_IMPORT_PLUGIN(QWebpPlugin) diff --git a/Telegram/packer_plugin_import.cpp b/Telegram/packer_plugin_import.cpp deleted file mode 100644 index 7c0d095425..0000000000 --- a/Telegram/packer_plugin_import.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// This file is autogenerated by qmake. It imports static plugin classes for -// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS. variables. -#include -Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) -Q_IMPORT_PLUGIN(QDDSPlugin) -Q_IMPORT_PLUGIN(QICNSPlugin) -Q_IMPORT_PLUGIN(QICOPlugin) -Q_IMPORT_PLUGIN(QJp2Plugin) -Q_IMPORT_PLUGIN(QMngPlugin) -Q_IMPORT_PLUGIN(QTgaPlugin) -Q_IMPORT_PLUGIN(QTiffPlugin) -Q_IMPORT_PLUGIN(QWbmpPlugin) -Q_IMPORT_PLUGIN(QWebpPlugin)