Fixes for Linux build

Travis CI used old cache and did not find the compilation
errors (instead it that errors has been found by us).
Also get rid of some Qt private parts, more fwd decls and so on.
This commit is contained in:
Alex Fails 2018-06-03 03:31:52 +03:00
parent d82f476623
commit 7d2b48ac65
24 changed files with 61 additions and 16 deletions

View File

@ -20,6 +20,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#pragma once #pragma once
#include <memory>
#include <QApplication> #include <QApplication>
#include <QLocalSocket> #include <QLocalSocket>
#include <QLocalServer> #include <QLocalServer>

View File

@ -21,6 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#pragma once #pragma once
#include <memory> #include <memory>
#include <cstddef> // std::max_align_t
#ifndef Assert #ifndef Assert
#define LambdaAssertDefined #define LambdaAssertDefined

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <deque> #include <deque>
#include <QMutex> #include <QMutex>
#include "base/lambda.h" #include "base/lambda.h"
#include "core/utils.h" #include "base/timer.h"
namespace base { namespace base {

View File

@ -23,6 +23,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "base/lambda.h" #include "base/lambda.h"
#include "base/observer.h" #include "base/observer.h"
using TimeMs = qint64;
namespace base { namespace base {
class Timer final : private QObject { class Timer final : private QObject {

View File

@ -20,10 +20,11 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#pragma once #pragma once
#include <QString>
#include <QUrl> #include <QUrl>
#include <QStringList> #include <QPoint>
#include <QString>
#include <QByteArray> #include <QByteArray>
#include <QStringList>
#include "base/observer.h" #include "base/observer.h"
// legacy // legacy

View File

@ -20,8 +20,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#pragma once #pragma once
#include <QtCore/QString> #include <QString>
#include <QtCore/QVector> #include <QVector>
extern inline bool cDebug();
class MTPlong; class MTPlong;
namespace Logs { namespace Logs {

View File

@ -20,12 +20,15 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "platform/linux/file_utilities_linux.h" #include "platform/linux/file_utilities_linux.h"
#include <private/qguiapplication_p.h> // #include <private/qguiapplication_p.h>
#include "platform/linux/linux_libs.h" #include "platform/linux/linux_libs.h"
#include "platform/linux/linux_gdk_helper.h" #include "platform/linux/linux_gdk_helper.h"
#include "messenger.h" #include "messenger.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "storage/localstorage.h" #include "storage/localstorage.h"
#include "facades.h"
#include <QProcess>
QStringList qt_make_filter_list(const QString &filter); QStringList qt_make_filter_list(const QString &filter);

View File

@ -19,9 +19,12 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "platform/linux/linux_desktop_environment.h" #include "platform/linux/linux_desktop_environment.h"
#include "logs.h"
#include <QDBusInterface> #include <QDBusInterface>
#define qstr QString // to avoid #include bloat utils.h
namespace Platform { namespace Platform {
namespace DesktopEnvironment { namespace DesktopEnvironment {
namespace { namespace {
@ -42,7 +45,7 @@ Type Compute() {
if (list.contains("unity")) { if (list.contains("unity")) {
// gnome-fallback sessions set XDG_CURRENT_DESKTOP to Unity // gnome-fallback sessions set XDG_CURRENT_DESKTOP to Unity
// DESKTOP_SESSION can be gnome-fallback or gnome-fallback-compiz // DESKTOP_SESSION can be gnome-fallback or gnome-fallback-compiz
if (desktopSession.indexOf(qstr("gnome-fallback")) >= 0) { if (desktopSession.indexOf(QString("gnome-fallback")) >= 0) {
return Type::Gnome; return Type::Gnome;
} }
return Type::Unity; return Type::Unity;
@ -53,7 +56,7 @@ Type Compute() {
} else if (list.contains("gnome")) { } else if (list.contains("gnome")) {
return Type::Gnome; return Type::Gnome;
} else if (list.contains("kde")) { } else if (list.contains("kde")) {
if (kdeSession == qstr("5")) { if (kdeSession == QString("5")) {
return Type::KDE5; return Type::KDE5;
} }
return Type::KDE4; return Type::KDE4;

View File

@ -20,6 +20,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#include "platform/linux/linux_libnotify.h" #include "platform/linux/linux_libnotify.h"
#include "logs.h"
#include "platform/linux/linux_libs.h" #include "platform/linux/linux_libs.h"
namespace Platform { namespace Platform {

View File

@ -20,6 +20,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#pragma once #pragma once
#include <QLibrary>
#include "logs.h"
namespace Platform { namespace Platform {
namespace Libs { namespace Libs {

View File

@ -29,6 +29,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "application.h" #include "application.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "storage/localstorage.h" #include "storage/localstorage.h"
#include "app.h"
#include "facades.h"
namespace Platform { namespace Platform {
namespace { namespace {

View File

@ -22,6 +22,11 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "platform/platform_main_window.h" #include "platform/platform_main_window.h"
#include <QTimer>
class QSystemTrayIcon;
class QMenu;
namespace Platform { namespace Platform {
class MainWindow : public Window::MainWindow { class MainWindow : public Window::MainWindow {

View File

@ -35,6 +35,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <iostream> #include <iostream>
#include <QAbstractNativeEventFilter>
#include <QDesktopWidget>
#include <QStandardPaths>
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
using namespace Platform; using namespace Platform;

View File

@ -17,9 +17,20 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/ */
#pragma once #pragma once
#include "base/timer.h" // TimeMs
#include <execinfo.h> #include <execinfo.h>
#include <signal.h> #include <signal.h>
#include <QFile>
#include <QString>
class QWidget;
class QPainter;
class QPaintEvent;
class QAbstractNativeEventFilter;
class LocationCoords;
namespace Platform { namespace Platform {
inline void SetWatchingMediaKeys(bool watching) { inline void SetWatchingMediaKeys(bool watching) {
@ -42,7 +53,7 @@ QString CurrentExecutablePath(int argc, char *argv[]);
} // namespace Platform } // namespace Platform
inline QString psServerPrefix() { inline QString psServerPrefix() {
return qsl("/tmp/"); return QStringLiteral("/tmp/");
} }
inline void psCheckLocalSocket(const QString &serverName) { inline void psCheckLocalSocket(const QString &serverName) {
QFile address(serverName); QFile address(serverName);

View File

@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_profile.h" #include "styles/style_profile.h"
#include <QWidget> #include <QWidget>
#include <qPaintEvent> #include <QPaintEvent>
namespace Profile { namespace Profile {

View File

@ -43,7 +43,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <QBuffer> #include <QBuffer>
#include <QImageReader> #include <QImageReader>
#include <QDirIterator> #include <QDirIterator>
#include <Qendian.h> #include <qendian.h>
namespace Local { namespace Local {
namespace { namespace {

View File

@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/effects/cross_animation.h" #include "ui/effects/cross_animation.h"
#include "ui/twidget.h" #include "ui/twidget.h"
#include <Qmath.h> #include <qmath.h>
namespace Ui { namespace Ui {
namespace { namespace {

View File

@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "structs.h" #include "structs.h"
#include "app.h" #include "app.h"
#include <Qevent.h> #include <qevent.h>
namespace Ui { namespace Ui {
namespace { namespace {

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_widgets.h" #include "styles/style_widgets.h"
#include <QPainter> #include <QPainter>
#include <Qevent.h> #include <qevent.h>
namespace Ui { namespace Ui {

View File

@ -29,7 +29,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "messenger.h" #include "messenger.h"
#include "app.h" #include "app.h"
#include <QStyle.h>
#include <QStyle> #include <QStyle>
#include <QStack> #include <QStack>
#include <QCommonStyle> #include <QCommonStyle>

View File

@ -21,6 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#pragma once #pragma once
#include <QIcon> #include <QIcon>
#include <QTimer>
#include <QMimeData> #include <QMimeData>
#include "window/window_title.h" #include "window/window_title.h"
#include "base/timer.h" #include "base/timer.h"

View File

@ -25,7 +25,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "window_slide_animation.h" #include "window_slide_animation.h"
#include "facades.h" #include "facades.h"
#include <Qevent.h> #include <QEvent>
#include <QPaintEvent>
namespace Window { namespace Window {

View File

@ -23,6 +23,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <algorithm> #include <algorithm>
#include "emoji_suggestions_data.h" #include "emoji_suggestions_data.h"
#include <stdint.h>
#ifndef Expects #ifndef Expects
#include <cassert> #include <cassert>
#define Expects(condition) assert(condition) #define Expects(condition) assert(condition)

View File

@ -21,6 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#pragma once #pragma once
#include <vector> #include <vector>
#include <string.h>
namespace Ui { namespace Ui {
namespace Emoji { namespace Emoji {