From: Manuel Nickschas Date: Mon, 8 Feb 2016 20:33:53 +0000 (+0100) Subject: Merge pull request #175 from ayonix/ssl-fix X-Git-Tag: travis-deploy-test~527 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=07d99f2b05f61df83278021d041d9e701a14f0d9;hp=98d707da4f2e7670efcadaaab3e13baf37838c56 Merge pull request #175 from ayonix/ssl-fix Fix the SSL check on systems that don't use OpenSSL --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 03aabeed..046b66d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,12 +217,21 @@ if (USE_QT5) PURPOSE "Required for audio notifications" ) - find_package(LibsnoreQt5 0.5.70 QUIET) + find_package(LibsnoreQt5 0.7.0 QUIET) set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL URL "https://projects.kde.org/projects/playground/libs/snorenotify" DESCRIPTION "a cross-platform notification framework" PURPOSE "Enable support for the snorenotify framework" ) + if(LibsnoreQt5_FOUND) + find_package(LibsnoreSettingsQt5) + set_package_properties(LibsnoreSettingsQt5 PROPERTIES TYPE REQUIRED + URL "https://projects.kde.org/projects/playground/libs/snorenotify" + DESCRIPTION "a cross-platform notification framework" + PURPOSE "Enable support for the snorenotify framework" + ) + endif() + if (WITH_WEBKIT) find_package(Qt5WebKit QUIET) diff --git a/appveyor.yml b/appveyor.yml index bb7cfc13..a97c2e26 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,9 +10,9 @@ build_script: Import-Module $env:APPVEYOR_BUILD_FOLDER\work\appveyorHelp.psm1 - Init @("ninja", "png2ico", "nsis") ([ordered]@{"git://anongit.kde.org/extra-cmake-modules.git" = @{"branch" = "master"}; + Init @("ninja", "png2ico", "nsis", "7zip.commandline") ([ordered]@{"git://anongit.kde.org/extra-cmake-modules.git" = @{"branch" = "master"}; "https://github.com/Snorenotify/SnoreGrowl.git" = @{"branch" = "v0.4.0"; "buildType" = "Release"}; - "git://anongit.kde.org/snorenotify.git" = @{"branch" = "v0.6.0"; "buildType" = "Release"}}) + "git://anongit.kde.org/snorenotify.git" = @{"branch" = "v0.7.0"; "buildType" = "Release"}}) mkdir -Force $env:APPVEYOR_BUILD_FOLDER\work\build\$env:APPVEYOR_PROJECT_NAME @@ -34,18 +34,15 @@ build_script: #snore "bin\\.*snore.*\.dll", "lib\\plugins\\libsnore.*\\libsnore_backend.*\.dll", - "lib\\plugins\\libsnore.*\\libsnore_secondary_backend.*\.dll", - #snorenotify 0.5 - "lib\\libsnore.*\\libsnore_backend.*\.dll", - # - "bin\\SnoreToast\.exe", + "lib\\plugins\\libsnore.*\\libsnore_settings_backend.*\.dll", + "lib\\plugins\\libsnore.*\\libsnore_secondarybackend.*\.dll", "lib\\plugins\\libsnore.*\\libsnore_settings_secondarybackend.*\.dll", "bin\\SnoreToast\.exe", # #Growl "bin\\.*snoregrowl.*\.dll", # #ssl - "bin\\libeay32\.dll", - "bin\\ssleay32\.dll", + ".*\\libeay32\.dll", + ".*\\ssleay32\.dll", # #icu "bin\\icuin\d+\.dll", @@ -93,25 +90,22 @@ build_script: "plugins\\phonon_backend\\.*", "plugins\\phonon4qt5_backend\\.*") @( #blacklist + "include", ".*\.h", - "lib\\plugins\\libsnore.*\\libsnore_backend_freedesktop\.dll" + "lib\\plugins\\libsnore.*\\libsnore_backend_freedesktop\.dll", + ".*\.pdb", + ".*plugind\.dll" ) mv "$imageDir\bin\*" "$imageDir\" #mv "$imageDir\lib\qca-qt5\crypto" "$imageDir\crypto" + mv "$imageDir\qml\*" "$imageDir" mv "$imageDir\plugins\*" "$imageDir" if(Test-Path "$imageDir\lib\plugins") { mv "$imageDir\lib\plugins\*" "$imageDir" } - #snorenotify 0.5 plugins - if(Test-Path "$imageDir\lib\libsnore-qt5") - { - mv "$imageDir\lib\libsnore-qt5\*" "$imageDir" - } - rm -Recurse "$imageDir\plugins\*" - rm -Recurse "$imageDir\lib" - rm -Recurse "$imageDir\bin" + DeleteEmptyFodlers $imageDir 7ZipDeployImage NsisDeployImage $env:APPVEYOR_BUILD_FOLDER\scripts\build\NullsoftInstaller.nsi @@ -119,11 +113,11 @@ environment: QT_VER: 5.5 matrix: - #mingw - - COMPILER: mingw492_32 #msvc - - COMPILER: msvc2013 - COMPILER: msvc2013_64 + - COMPILER: msvc2013 + #mingw + - COMPILER: mingw492_32 test: off diff --git a/scripts/build/NullsoftInstaller.nsi b/scripts/build/NullsoftInstaller.nsi index 028067ef..81d9cf84 100644 --- a/scripts/build/NullsoftInstaller.nsi +++ b/scripts/build/NullsoftInstaller.nsi @@ -86,7 +86,7 @@ SetDatablockOptimize on CRCCheck on SilentInstall normal -InstallDir "$PROGRAMFILES\${productname}" +InstallDir "${defaultinstdir}\${productname}" InstallDirRegKey HKLM "${regkey}" "" diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 4d49efb2..ddc71dd4 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -463,6 +463,12 @@ bool QueryBufferItem::setData(int column, const QVariant &value, int role) case Qt::EditRole: { QString newName = value.toString(); + + // Sanity check - buffer names must not contain newlines! + int nlpos = newName.indexOf('\n'); + if (nlpos >= 0) + newName = newName.left(nlpos); + if (!newName.isEmpty()) { Client::renameBuffer(bufferId(), newName); return true; diff --git a/src/client/selectionmodelsynchronizer.cpp b/src/client/selectionmodelsynchronizer.cpp index 0dcf7f8e..14c57c06 100644 --- a/src/client/selectionmodelsynchronizer.cpp +++ b/src/client/selectionmodelsynchronizer.cpp @@ -255,6 +255,13 @@ void SelectionModelSynchronizer::currentChanged(const QModelIndex ¤t, cons ++iter; } _changeCurrentEnabled = true; + + // Trigger a dataChanged() signal from the base model to update all proxy models (e.g. filters). + // Since signals are protected, we have to use invokeMethod for faking signal emission. + if (previous.isValid()) { + QMetaObject::invokeMethod(model(), "dataChanged", Qt::DirectConnection, + Q_ARG(QModelIndex, previous), Q_ARG(QModelIndex, previous)); + } } diff --git a/src/common/peer.cpp b/src/common/peer.cpp index 3785326c..c076806f 100644 --- a/src/common/peer.cpp +++ b/src/common/peer.cpp @@ -34,20 +34,23 @@ AuthHandler *Peer::authHandler() const } -// Note that we need to use a fixed-size integer instead of uintptr_t, in order -// to avoid issues with different architectures for client and core. -// In practice, we'll never really have to restore the real value of a PeerPtr from -// a QVariant. +// PeerPtr is used in RPC signatures for enabling receivers to send replies +// to a particular peer rather than broadcast to all connected ones. +// To enable this, the SignalProxy transparently replaces the bogus value +// received over the network with the actual address of the local Peer +// instance. Because the actual value isn't needed on the wire, it is +// serialized as null. QDataStream &operator<<(QDataStream &out, PeerPtr ptr) { - out << reinterpret_cast(ptr); + Q_UNUSED(ptr); + out << static_cast(0); // 64 bit for historic reasons return out; } QDataStream &operator>>(QDataStream &in, PeerPtr &ptr) { + ptr = nullptr; quint64 value; in >> value; - ptr = reinterpret_cast(value); return in; } diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index 6987ec60..8510a715 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -99,7 +99,7 @@ if (LibsnoreQt5_FOUND) add_definitions(-DHAVE_LIBSNORE) list(APPEND SOURCES snorenotificationbackend.cpp) list(APPEND FORMS snorentificationconfigwidget.ui) - list(APPEND LIBS Snore::Libsnore) + list(APPEND LIBS Snore::Libsnore Snore::LibsnoreSettings) endif() if (PHONON_FOUND OR Phonon4Qt5_FOUND) diff --git a/src/qtui/snorenotificationbackend.cpp b/src/qtui/snorenotificationbackend.cpp index 72873c1e..69ce0e0a 100644 --- a/src/qtui/snorenotificationbackend.cpp +++ b/src/qtui/snorenotificationbackend.cpp @@ -43,9 +43,9 @@ SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent) Snore::SnoreCore::instance().loadPlugins( #ifndef HAVE_KDE - Snore::SnorePlugin::BACKEND | + Snore::SnorePlugin::Backend | #endif - Snore::SnorePlugin::SECONDARY_BACKEND); + Snore::SnorePlugin::SecondaryBackend | Snore::SnorePlugin::Settings); m_application = Snore::Application("Quassel", m_icon); m_application.hints().setValue("windows-app-id","QuasselProject.QuasselIRC"); m_application.hints().setValue("pushover-token", "arNtsi983QSZUqU3KAZrFLKHGFPkdL"); @@ -91,7 +91,7 @@ void SnoreNotificationBackend::close(uint notificationId) } #endif Snore::Notification n = Snore::SnoreCore::instance().getActiveNotificationByID(m_notificationIds.take(notificationId)); - Snore::SnoreCore::instance().requestCloseNotification(n, Snore::Notification::CLOSED); + Snore::SnoreCore::instance().requestCloseNotification(n, Snore::Notification::Closed); } void SnoreNotificationBackend::actionInvoked(Snore::Notification n) diff --git a/src/qtui/ui/snorentificationconfigwidget.ui b/src/qtui/ui/snorentificationconfigwidget.ui index 991e37b6..117fc986 100644 --- a/src/qtui/ui/snorentificationconfigwidget.ui +++ b/src/qtui/ui/snorentificationconfigwidget.ui @@ -55,7 +55,7 @@ Snore::SettingsDialog QWidget -
libsnore/settingsdialog.h
+
libsnore/settings/settingsdialog.h
1
diff --git a/src/uisupport/action.cpp b/src/uisupport/action.cpp index c222dc19..2758e770 100644 --- a/src/uisupport/action.cpp +++ b/src/uisupport/action.cpp @@ -98,11 +98,16 @@ void Action::setShortcutConfigurable(bool b) QKeySequence Action::shortcut(ShortcutTypes type) const { Q_ASSERT(type); - if (type == DefaultShortcut) + if (type == DefaultShortcut) { +#if QT_VERSION < 0x050000 return property("defaultShortcut").value(); +#else + auto sequence = property("defaultShortcuts").value>(); + return sequence.isEmpty() ? QKeySequence() : sequence.first(); +#endif + } - if (shortcuts().count()) return shortcuts().value(0); - return QKeySequence(); + return shortcuts().isEmpty() ? QKeySequence() : shortcuts().first(); } @@ -116,9 +121,13 @@ void Action::setShortcut(const QKeySequence &key, ShortcutTypes type) { Q_ASSERT(type); - if (type & DefaultShortcut) + if (type & DefaultShortcut) { +#if QT_VERSION < 0x050000 setProperty("defaultShortcut", key); - +#else + setProperty("defaultShortcuts", QVariant::fromValue(QList() << key)); +#endif + } if (type & ActiveShortcut) QAction::setShortcut(key); } diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index d0921466..c27e3a31 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -158,21 +158,6 @@ void BufferView::setFilteredModel(QAbstractItemModel *model_, BufferViewConfig * } -void BufferView::setSelectionModel(QItemSelectionModel *selectionModel) -{ - if (QTreeView::selectionModel()) - disconnect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), - model(), SIGNAL(checkPreviousCurrentForRemoval(QModelIndex, QModelIndex))); - - QTreeView::setSelectionModel(selectionModel); - BufferViewFilter *filter = qobject_cast(model()); - if (filter) { - connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), - filter, SLOT(checkPreviousCurrentForRemoval(QModelIndex, QModelIndex))); - } -} - - void BufferView::setConfig(BufferViewConfig *config) { if (_config == config) diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index a49ce15c..2962e5e9 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -52,7 +52,6 @@ public: void setModel(QAbstractItemModel *model); void setFilteredModel(QAbstractItemModel *model, BufferViewConfig *config); - virtual void setSelectionModel(QItemSelectionModel *selectionModel); void setConfig(BufferViewConfig *config); inline BufferViewConfig *config() { return _config; } diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index c829267a..4c5d4a9c 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -33,13 +33,6 @@ #include "networkmodel.h" #include "uistyle.h" -class CheckRemovalEvent : public QEvent -{ -public: - CheckRemovalEvent(const QModelIndex &source_index) : QEvent(QEvent::User), index(source_index) {}; - QPersistentModelIndex index; -}; - /***************************************** * The Filter for the Tree View @@ -57,9 +50,6 @@ BufferViewFilter::BufferViewFilter(QAbstractItemModel *model, BufferViewConfig * setDynamicSortFilter(true); - connect(this, SIGNAL(_dataChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(_q_sourceDataChanged(QModelIndex, QModelIndex))); - _enableEditMode.setCheckable(true); _enableEditMode.setChecked(_editMode); connect(&_enableEditMode, SIGNAL(toggled(bool)), this, SLOT(enableEditMode(bool))); @@ -542,34 +532,6 @@ bool BufferViewFilter::setCheckedState(const QModelIndex &index, Qt::CheckState } -void BufferViewFilter::checkPreviousCurrentForRemoval(const QModelIndex ¤t, const QModelIndex &previous) -{ - Q_UNUSED(current); - if (previous.isValid()) - QCoreApplication::postEvent(this, new CheckRemovalEvent(previous)); -} - - -void BufferViewFilter::customEvent(QEvent *event) -{ - if (event->type() != QEvent::User) - return; - - CheckRemovalEvent *removalEvent = static_cast(event); - checkItemForRemoval(removalEvent->index); - - event->accept(); -} - - -void BufferViewFilter::checkItemsForRemoval(const QModelIndex &topLeft, const QModelIndex &bottomRight) -{ - QModelIndex source_topLeft = mapToSource(topLeft); - QModelIndex source_bottomRight = mapToSource(bottomRight); - emit _dataChanged(source_topLeft, source_bottomRight); -} - - bool BufferViewFilter::bufferIdLessThan(const BufferId &left, const BufferId &right) { Q_CHECK_PTR(Client::networkModel()); diff --git a/src/uisupport/bufferviewfilter.h b/src/uisupport/bufferviewfilter.h index 1a4d7818..5cf0ccec 100644 --- a/src/uisupport/bufferviewfilter.h +++ b/src/uisupport/bufferviewfilter.h @@ -69,20 +69,13 @@ public: QList actions(const QModelIndex &index); -public slots: - void checkPreviousCurrentForRemoval(const QModelIndex ¤t, const QModelIndex &previous); - void checkItemForRemoval(const QModelIndex &index) { checkItemsForRemoval(index, index); } - void checkItemsForRemoval(const QModelIndex &topLeft, const QModelIndex &bottomRight); - protected: bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; bool bufferLessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; bool networkLessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; - virtual void customEvent(QEvent *event); signals: - void _dataChanged(const QModelIndex &source_topLeft, const QModelIndex &source_bottomRight); void configChanged(); private slots: