From 087483971ea3f81383e40e6bdc150b54c7dd2baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Tue, 3 Sep 2019 11:09:57 -0400 Subject: [PATCH] build: fix build on linux Change-Id: Ie802c7aebe23ef30a18c0765ac9878d3a57b913c --- advancedsettingswidget.ui | 2 +- advancedsipsettingwidget.ui | 2 +- downloadmanager.cpp | 2 + jami-qt.pro | 256 +++++++++++++++++++----------------- levelmeter.cpp | 1 + main.cpp | 2 +- messagewebview.cpp | 4 +- photoboothwidget.cpp | 4 +- photoboothwidget.h | 2 +- runguard.cpp | 2 + settingswidget.cpp | 12 +- settingswidget.ui | 2 +- utils.cpp | 4 + 13 files changed, 160 insertions(+), 135 deletions(-) diff --git a/advancedsettingswidget.ui b/advancedsettingswidget.ui index 1561ef6..40c56ac 100644 --- a/advancedsettingswidget.ui +++ b/advancedsettingswidget.ui @@ -1421,7 +1421,7 @@ <customwidget> <class>ToggleSwitch</class> <extends>QWidget</extends> - <header>ToggleSwitch.h</header> + <header>toggleswitch.h</header> <container>1</container> </customwidget> </customwidgets> diff --git a/advancedsipsettingwidget.ui b/advancedsipsettingwidget.ui index a1e67df..b62cb83 100644 --- a/advancedsipsettingwidget.ui +++ b/advancedsipsettingwidget.ui @@ -1952,7 +1952,7 @@ <customwidget> <class>ToggleSwitch</class> <extends>QWidget</extends> - <header>ToggleSwitch.h</header> + <header>toggleswitch.h</header> <container>1</container> </customwidget> </customwidgets> diff --git a/downloadmanager.cpp b/downloadmanager.cpp index d6f1bee..2d197b2 100644 --- a/downloadmanager.cpp +++ b/downloadmanager.cpp @@ -22,7 +22,9 @@ #include <QMessageBox> +#ifdef Q_OS_WIN #include <windows.h> +#endif // !Q_OS_WIN DownloadManager::DownloadManager() {} diff --git a/jami-qt.pro b/jami-qt.pro index 2ef752f..40015ae 100644 --- a/jami-qt.pro +++ b/jami-qt.pro @@ -1,7 +1,9 @@ TEMPLATE = app TARGET = jami-qt -QT += widgets xml multimedia multimediawidgets network webenginewidgets +CONFIG += c++17 + +QT += widgets xml multimedia multimediawidgets network webenginewidgets svg isEmpty(LRC) { LRC=../../install/lrc/ @@ -14,128 +16,134 @@ LIBS += -L$${LRC}/lib -lringclient LIBS += -lqrencode # Input -HEADERS += ./pixbufmanipulator.h \ - ./ringthemeutils.h \ - ./runguard.h \ - ./settingskey.h \ - ./utils.h \ - ./version.h \ - ./webchathelpers.h \ - ./windowscontactbackend.h \ - ./aboutdialog.h \ - ./callwidget.h \ - ./accountlistmodel.h \ - ./accountitemdelegate.h \ - ./deleteaccountdialog.h \ - ./globalsystemtray.h \ - ./idlabel.h \ - ./mainwindow.h \ - ./navwidget.h \ - ./photoboothwidget.h \ - ./invitebuttonswidget.h \ - ./currentaccountcombobox.h \ - ./animationhelpers.h \ - ./advancedsettingswidget.h \ - ./avatargraphicsview.h \ - ./bannedlistmodel.h \ - ./linkdevicedialog.h \ - ./bezierconnectorwidget.h \ - ./lrcinstance.h \ - ./messagewebview.h \ - ./messagewebpage.h \ - ./passworddialog.h \ - ./newwizardwidget.h \ - ./advancedsipsettingwidget.h \ - ./iconbutton.h \ - ./deviceitemwidget.h \ - ./banneditemwidget.h \ - ./ringbutton.h \ - ./ringcontactlineedit.h \ - ./nameregistrationdialog.h \ - ./selectareadialog.h \ - ./smartlistview.h \ - ./conversationitemdelegate.h \ - ./smartlistmodel.h \ - ./conversationsfilterwidget.h \ - ./smartlistselectorbuttonnotifier.h \ - ./settingswidget.h \ - ./toggleswitch.h \ - ./videooverlay.h \ - ./videoview.h \ - ./videowidget.h \ - ./downloadbar.h \ - ./updateconfirmdialog.h \ - ./downloadmanger.h -SOURCES += ./advancedsettingswidget.cpp \ - ./advancedsipsettingwidget.cpp \ - ./avatargraphicsview.cpp \ - ./banneditemwidget.cpp \ - ./bannedlistmodel.cpp \ - ./animationhelpers.cpp \ - ./currentaccountcombobox.cpp \ - ./aboutdialog.cpp \ - ./accountitemdelegate.cpp \ - ./accountlistmodel.cpp \ - ./callwidget.cpp \ - ./deleteaccountdialog.cpp \ - ./deviceitemwidget.cpp \ - ./globalsystemtray.cpp \ - ./iconbutton.cpp \ - ./idlabel.cpp \ - ./bezierconnectorwidget.cpp \ - ./invitebuttonswidget.cpp \ - ./linkdevicedialog.cpp \ - ./main.cpp \ - ./mainwindow.cpp \ - ./messagewebpage.cpp \ - ./messagewebview.cpp \ - ./navwidget.cpp \ - ./newwizardwidget.cpp \ - ./passworddialog.cpp \ - ./photoboothwidget.cpp \ - ./pixbufmanipulator.cpp \ - ./nameregistrationdialog.cpp \ - ./ringbutton.cpp \ - ./ringcontactlineedit.cpp \ - ./runguard.cpp \ - ./selectareadialog.cpp \ - ./conversationsfilterwidget.cpp \ - ./settingswidget.cpp \ - ./smartlistselectorbuttonnotifier.cpp \ - ./smartlistview.cpp \ - ./conversationitemdelegate.cpp \ - ./smartlistmodel.cpp \ - ./toggleswitch.cpp \ - ./utils.cpp \ - ./videooverlay.cpp \ - ./videoview.cpp \ - ./videowidget.cpp \ - ./webchathelpers.cpp \ - ./windowscontactbackend.cpp \ - ./downloadbar.cpp \ - ./updateconfirmdialog.cpp \ - ./downloadmanger.cpp +HEADERS += ./aboutdialog.h \ + ./banneditemwidget.h \ + ./conversationsfilterwidget.h \ + ./idlabel.h \ + ./messagewebview.h \ + ./ringbutton.h \ + ./smartlistmodel.h \ + ./utils.h \ + ./accountitemdelegate.h \ + ./bannedlistmodel.h \ + ./currentaccountcombobox.h \ + ./invitebuttonswidget.h \ + ./nameregistrationdialog.h \ + ./ringcontactlineedit.h \ + ./smartlistselectorbuttonnotifier.h \ + ./version.h \ + ./accountlistmodel.h \ + ./bezierconnectorwidget.h \ + ./deleteaccountdialog.h \ + ./levelmeter.h \ + ./navwidget.h \ + ./ringthemeutils.h \ + ./smartlistview.h \ + ./videooverlay.h \ + ./advancedsettingswidget.h \ + ./callwidget.h \ + ./deviceitemwidget.h \ + ./linkdevicedialog.h \ + ./newwizardwidget.h \ + ./runguard.h \ + ./splashscreen.h \ + ./videoview.h \ + ./advancedsipsettingwidget.h \ + ./contactpicker.h \ + ./downloadmanager.h \ + ./lrcinstance.h \ + ./passworddialog.h \ + ./selectareadialog.h \ + ./toggleswitch.h \ + ./videowidget.h \ + ./animationhelpers.h \ + ./contactpickeritemdelegate.h \ + ./globalsystemtray.h \ + ./mainwindow.h \ + ./photoboothwidget.h \ + ./settingskey.h \ + ./updateconfirmdialog.h \ + ./webchathelpers.h \ + ./avatargraphicsview.h \ + ./conversationitemdelegate.h \ + ./iconbutton.h \ + ./messagewebpage.h \ + ./pixbufmanipulator.h \ + ./settingswidget.h \ + ./updatedownloaddialog.h +SOURCES += ./aboutdialog.cpp \ + ./banneditemwidget.cpp \ + ./conversationsfilterwidget.cpp \ + ./idlabel.cpp \ + ./messagewebview.cpp \ + ./ringbutton.cpp \ + ./smartlistview.cpp \ + ./videoview.cpp \ + ./accountitemdelegate.cpp \ + ./bannedlistmodel.cpp \ + ./currentaccountcombobox.cpp \ + ./invitebuttonswidget.cpp \ + ./nameregistrationdialog.cpp \ + ./ringcontactlineedit.cpp \ + ./splashscreen.cpp \ + ./videowidget.cpp \ + ./accountlistmodel.cpp \ + ./bezierconnectorwidget.cpp \ + ./deleteaccountdialog.cpp \ + ./levelmeter.cpp \ + ./navwidget.cpp \ + ./runguard.cpp \ + ./toggleswitch.cpp \ + ./webchathelpers.cpp \ + ./advancedsettingswidget.cpp \ + ./callwidget.cpp \ + ./deviceitemwidget.cpp \ + ./linkdevicedialog.cpp \ + ./newwizardwidget.cpp \ + ./selectareadialog.cpp \ + ./updateconfirmdialog.cpp \ + ./advancedsipsettingwidget.cpp \ + ./contactpicker.cpp \ + ./downloadmanager.cpp \ + ./main.cpp \ + ./passworddialog.cpp \ + ./settingswidget.cpp \ + ./updatedownloaddialog.cpp \ + ./animationhelpers.cpp \ + ./contactpickeritemdelegate.cpp \ + ./globalsystemtray.cpp \ + ./mainwindow.cpp \ + ./photoboothwidget.cpp \ + ./smartlistmodel.cpp \ + ./utils.cpp \ + ./avatargraphicsview.cpp \ + ./conversationitemdelegate.cpp \ + ./iconbutton.cpp \ + ./messagewebpage.cpp \ + ./pixbufmanipulator.cpp \ + ./smartlistselectorbuttonnotifier.cpp \ + ./videooverlay.cpp FORMS += ./aboutdialog.ui \ - ./advancedsettingswidget.ui \ - ./advancedsipsettingwidget.ui \ - ./animatedoverlay.ui \ - ./banneditemwidget.ui \ - ./callwidget.ui \ - ./deleteaccountdialog.ui \ - ./deviceitemwidget.ui \ - ./invitebuttonswidget.ui \ - ./linkdevicedialog.ui \ - ./mainwindow.ui \ - ./nameregistrationdialog.ui \ - ./newwizardwidget.ui \ - ./passworddialog.ui \ - ./photoboothdialog.ui \ - ./photoboothwidget.ui \ - ./ringbutton.ui \ - ./settingswidget.ui \ - ./videooverlay.ui \ - ./videoview.ui \ - ./downloadbar.ui \ - ./updateconfirmdialog.ui \ - ./contactpicker.ui + ./advancedsipsettingwidget.ui \ + ./callwidget.ui \ + ./deviceitemwidget.ui \ + ./mainwindow.ui \ + ./passworddialog.ui \ + ./ringbutton.ui \ + ./updatedownloaddialog.ui \ + ./animatedoverlay.ui \ + ./contactpicker.ui \ + ./invitebuttonswidget.ui \ + ./nameregistrationdialog.ui \ + ./photoboothdialog.ui \ + ./settingswidget.ui \ + ./videooverlay.ui \ + ./advancedsettingswidget.ui \ + ./banneditemwidget.ui \ + ./deleteaccountdialog.ui \ + ./linkdevicedialog.ui \ + ./newwizardwidget.ui \ + ./photoboothwidget.ui \ + ./updateconfirmdialog.ui \ + ./videoview.ui RESOURCES += ressources.qrc diff --git a/levelmeter.cpp b/levelmeter.cpp index f627786..176c201 100644 --- a/levelmeter.cpp +++ b/levelmeter.cpp @@ -21,6 +21,7 @@ #include <QTimer> #include <QDebug> +#include <algorithm> #include <cmath> #include <limits> diff --git a/main.cpp b/main.cpp index 4ab64cd..9d13ed6 100644 --- a/main.cpp +++ b/main.cpp @@ -183,7 +183,7 @@ main(int argc, char* argv[]) GlobalInstances::setPixmapManipulator(std::make_unique<PixbufManipulator>()); SplashScreen* splash = new SplashScreen(); - std::atomic_bool isMigrating = false; + std::atomic_bool isMigrating(false); LRCInstance::init( [&splash, &a, &isMigrating] { splash->setupUI( diff --git a/messagewebview.cpp b/messagewebview.cpp index cf9f907..f974cb3 100644 --- a/messagewebview.cpp +++ b/messagewebview.cpp @@ -25,9 +25,9 @@ #include <QDebug> #include <QDesktopServices> #include <QFileDialog> -#include <QImagereader> +#include <QImageReader> #include <QMenu> -#include <QMessagebox> +#include <QMessageBox> #include <QMimeData> #include <QMouseEvent> #include <QScrollBar> diff --git a/photoboothwidget.cpp b/photoboothwidget.cpp index 594a172..ef8d700 100644 --- a/photoboothwidget.cpp +++ b/photoboothwidget.cpp @@ -143,11 +143,11 @@ PhotoboothWidget::on_takePhotoButton_clicked() } void -PhotoboothWidget::setAvatarPixmap(const QPixmap& avatarPixmap, bool default) +PhotoboothWidget::setAvatarPixmap(const QPixmap& avatarPixmap, bool _default) { ui->avatarLabel->setPixmap(avatarPixmap); stopBooth(); - if (default) { + if (_default) { ui->takePhotoButton->setIcon(QIcon(":/images/icons/round-add_a_photo-24px.svg")); } } diff --git a/photoboothwidget.h b/photoboothwidget.h index 86cf88d..5336cce 100644 --- a/photoboothwidget.h +++ b/photoboothwidget.h @@ -37,7 +37,7 @@ public: void startBooth(); void stopBooth(); - void setAvatarPixmap(const QPixmap& avatarPixmap, bool default = false); + void setAvatarPixmap(const QPixmap& avatarPixmap, bool _default = false); const QPixmap& getAvatarPixmap(); bool hasAvatar(); diff --git a/runguard.cpp b/runguard.cpp index 46651bc..c5ff572 100644 --- a/runguard.cpp +++ b/runguard.cpp @@ -74,6 +74,7 @@ bool RunGuard::isAnotherRunning() bool RunGuard::tryToRun() { +#ifdef Q_OS_WIN if (isAnotherRunning()) { // This is a secondary instance, // connect to the primary instance to trigger a restore @@ -111,6 +112,7 @@ bool RunGuard::tryToRun() this, &RunGuard::tryRestorePrimaryInstance ); +#endif return true; } diff --git a/settingswidget.cpp b/settingswidget.cpp index a420cf7..68caee5 100644 --- a/settingswidget.cpp +++ b/settingswidget.cpp @@ -1134,7 +1134,11 @@ void SettingsWidget::startAudioMeter(bool blocking) LRCInstance::avModel().startAudioDevice(); LRCInstance::avModel().setAudioMeterState(true); }; - blocking ? f() : QtConcurrent::run(f); + if (blocking) { + f(); + } else { + QtConcurrent::run(f); + } } void SettingsWidget::stopAudioMeter(bool blocking) @@ -1145,5 +1149,9 @@ void SettingsWidget::stopAudioMeter(bool blocking) LRCInstance::avModel().setAudioMeterState(false); ui->audioInputMeter->stop(); auto f = [this] { LRCInstance::avModel().stopAudioDevice(); }; - blocking ? f() : QtConcurrent::run(f); + if (blocking) { + f(); + } else { + QtConcurrent::run(f); + } } \ No newline at end of file diff --git a/settingswidget.ui b/settingswidget.ui index a0b9cfe..4198f39 100644 --- a/settingswidget.ui +++ b/settingswidget.ui @@ -4223,7 +4223,7 @@ <customwidget> <class>ToggleSwitch</class> <extends>QWidget</extends> - <header>ToggleSwitch.h</header> + <header>toggleswitch.h</header> <container>1</container> </customwidget> <customwidget> diff --git a/utils.cpp b/utils.cpp index 134df0a..ada8109 100644 --- a/utils.cpp +++ b/utils.cpp @@ -289,12 +289,16 @@ void Utils::showSystemNotification(QWidget* widget, QSize Utils::getRealSize(QScreen* screen) { +#ifdef Q_OS_WIN DEVMODE dmThisScreen; ZeroMemory(&dmThisScreen, sizeof(dmThisScreen)); EnumDisplaySettings((const wchar_t *)screen->name().utf16(), ENUM_CURRENT_SETTINGS, (DEVMODE*)&dmThisScreen); return QSize(dmThisScreen.dmPelsWidth, dmThisScreen.dmPelsHeight); +#else + return {}; +#endif } void -- GitLab