quassel.git
9 years agoLegacyPeer: kill the dependency to Quassel::buildInfo() 82/head
J-P Nurmi [Thu, 10 Jul 2014 22:11:27 +0000 (00:11 +0200)]
LegacyPeer: kill the dependency to Quassel::buildInfo()

This makes LegacyPeer usable outside Quassel (IRC for Sailfish)

9 years agoUse correct nick on 001 RPL_WELCOME
Mattia Basaglia [Thu, 26 Jun 2014 13:23:13 +0000 (15:23 +0200)]
Use correct nick on 001 RPL_WELCOME

Fixes #1020
When the user connects to  a bouncer, the bouncer will send back the
welcome message received when it first connected to the network.
This caused Quassel to display a wrong nick if it had changed
since the first connection.

9 years agoMerge pull request #81 from otih/master
Manuel Nickschas [Sat, 5 Jul 2014 20:14:00 +0000 (22:14 +0200)]
Merge pull request #81 from otih/master

Fix Bug #1293: --syslog option writes to emergency level

9 years agoFix Bug #1293: --syslog option writes to emergency level 81/head
otih [Thu, 3 Jul 2014 21:34:44 +0000 (23:34 +0200)]
Fix Bug #1293: --syslog option writes to emergency level

9 years agoFix Bug #1293: --syslog option writes to emergency level
otih [Thu, 3 Jul 2014 20:58:35 +0000 (22:58 +0200)]
Fix Bug #1293: --syslog option writes to emergency level

9 years agoDon't treat pure format strings as translatable.
Daniel Albers [Wed, 2 Jul 2014 15:34:21 +0000 (17:34 +0200)]
Don't treat pure format strings as translatable.

9 years agoMerge pull request #78 from seezer/qt5contextmenu
Manuel Nickschas [Wed, 2 Jul 2014 22:43:01 +0000 (00:43 +0200)]
Merge pull request #78 from seezer/qt5contextmenu

Fix contextmenu actions for Qt5

9 years agoMerge pull request #73 from jpnurmi/signalproxy
Manuel Nickschas [Wed, 2 Jul 2014 22:24:47 +0000 (00:24 +0200)]
Merge pull request #73 from jpnurmi/signalproxy

signalproxy.h: add missing forward declaration of QIODevice

9 years agoMerge pull request #72 from jpnurmi/datastream
Manuel Nickschas [Wed, 2 Jul 2014 22:22:57 +0000 (00:22 +0200)]
Merge pull request #72 from jpnurmi/datastream

DataStreamPeer: add missing include <QDataStream>

9 years agoFix contextmenu actions for Qt5 78/head
Sebastian Goth [Tue, 17 Jun 2014 19:33:21 +0000 (21:33 +0200)]
Fix contextmenu actions for Qt5

As documented for QObject::connectNotify

9 years agoChecking for single char line endings
Sebastian Meyer [Fri, 13 Jun 2014 12:52:55 +0000 (14:52 +0200)]
Checking for single char line endings

This fixes problems with IRC servers sending only single char line
endings. Before the last char on each line for thos servers would be
chopped, now Quassel checks how the line ends and chops accordingly.
Fixes #1267

9 years agoFix build on KDE
Manuel Nickschas [Fri, 9 May 2014 19:38:37 +0000 (21:38 +0200)]
Fix build on KDE

Oops. This wouldn't have happened with 'auto' :P

9 years agoFix tab completion on exotic platforms
Manuel Nickschas [Mon, 5 May 2014 21:38:27 +0000 (23:38 +0200)]
Fix tab completion on exotic platforms

Turns out that using the tab key as an action shortcut in an input widget
does not work reliably on all platforms, at least on OS/2 - sometimes,
the event filter would be called instead of triggering the action.

To make this more robust, we disable the action (just using it as a container
for the custom shortcut) and always catch and handle the key in the event
filter which we need anyway.

Thanks to TeLLie for bisecting this issue and finding the culprit on OS/2.

9 years agoUpdate ChangeLog
Manuel Nickschas [Mon, 5 May 2014 18:47:40 +0000 (20:47 +0200)]
Update ChangeLog

9 years agoFix crash with KDE network detection
Manuel Nickschas [Mon, 5 May 2014 18:37:36 +0000 (20:37 +0200)]
Fix crash with KDE network detection

If the network connection status changed during authentication phase,
Quassel would crash. This is caused by some old bits of code that still
assume that there's always a Peer around, which is no longer the case
after splitting off the AuthHandler.

This commit fixes that issue. Thanks to shadeslayer for the report and
really useful backtrace.

9 years agosignalproxy.h: add missing forward declaration of QIODevice 73/head
J-P Nurmi [Mon, 28 Apr 2014 21:06:58 +0000 (23:06 +0200)]
signalproxy.h: add missing forward declaration of QIODevice

9 years agoDataStreamPeer: add missing include <QDataStream> 72/head
J-P Nurmi [Mon, 28 Apr 2014 21:05:00 +0000 (23:05 +0200)]
DataStreamPeer: add missing include <QDataStream>

10 years agoBuild mono client packages on Mac OS X
Marcus Eggenberger [Wed, 9 Apr 2014 12:58:49 +0000 (14:58 +0200)]
Build mono client packages on Mac OS X

When deploying on Mac OS X, also build a disk image (dmg) for the mono
client. Also updated cmake files for OS X 10.8.

10 years agoMake sure our Qt5 is new enough
Manuel Nickschas [Mon, 31 Mar 2014 22:07:45 +0000 (00:07 +0200)]
Make sure our Qt5 is new enough

find_package will happily ignore the requested version if not used
with REQUIRED, plus early Qt5 versions handled versions differently;
thus, let's explicitly check for a supported version and bail out
otherwise.

10 years agoWe don't actually require XmlPatterns for WebKit
Manuel Nickschas [Mon, 31 Mar 2014 21:14:55 +0000 (23:14 +0200)]
We don't actually require XmlPatterns for WebKit

No clue why we forced linking against that one, but it doesn't seem
to be required for both Qt4 and Qt5, so let's just remove the dependency.

10 years agoMake --syslog option work again
Manuel Nickschas [Mon, 31 Mar 2014 20:12:28 +0000 (22:12 +0200)]
Make --syslog option work again

The -DHAVE_SYSLOG was missing for compiling main() after the recent
build system changes, so the option wasn't enabled (but caused a
warning).

10 years agoBring back COMMON_DEPS
Manuel Nickschas [Mon, 31 Mar 2014 20:03:54 +0000 (22:03 +0200)]
Bring back COMMON_DEPS

This is actually being used to link the app icon on Windows, so bring
the old variables back for now. Probably want to clean this up later
though, as the naming is confusing.

10 years agoFix Qt resource handling
Manuel Nickschas [Mon, 31 Mar 2014 19:58:27 +0000 (21:58 +0200)]
Fix Qt resource handling

Turns out we have to explicitly initialize Qt resources that are linked
statically, so our last build system change broke things because the
files where nowhere to be found.

This now initializes the resources in main(); additionally, we use absolute
paths for the qrc files now, simply for making things a bit clearer.

10 years agoMerge pull request #69 from Nevcairiel/qt5msvcbuild
Manuel Nickschas [Sun, 30 Mar 2014 20:45:19 +0000 (22:45 +0200)]
Merge pull request #69 from Nevcairiel/qt5msvcbuild

Qt5 MSVC build fixes

10 years agoFix linking against Qt5 on MSVC 69/head
Hendrik Leppkes [Sat, 29 Mar 2014 16:18:22 +0000 (17:18 +0100)]
Fix linking against Qt5 on MSVC

QT_QTMAIN_LIBRARY is no longer automatically set on Qt5, as it is part of
a deprecated way to link against Qt. Since Quassel needs to support both
Qt4 and Qt5, setting the variable to the appropriate value again works
around the issue until such a time that the CMake requirement is increased
to make use of policy CMP0020.

Note that this is the same workaround cmake itself uses when building
cmake-gui for Windows.

10 years agoFix building with Qt5 on MSVC by undefining min/max macros
Hendrik Leppkes [Sat, 29 Mar 2014 16:16:13 +0000 (17:16 +0100)]
Fix building with Qt5 on MSVC by undefining min/max macros

The Windows stdlib.h header defines min/max macros, which interfer with
the Qt5 header files. Luckily, it also provides the define NOMINMAX which
suppresses these macros, and fix building.

10 years agoAvoid race conditions in the build system
Manuel Nickschas [Fri, 28 Mar 2014 23:57:22 +0000 (00:57 +0100)]
Avoid race conditions in the build system

Adding resource files in multiple targets is a bad idea, because CMake
will happily generate them multiple times too, and unfortunately also
in the same location. With Qt5, this actually lead to a misgenerated
oxygen_kde.qrc some times.

Now we add the resources in the module they belong to, which not only
avoids these race conditions, but also saves some time during compile,
because every resource file is only processed once now.

Changing this triggered yet another race condition, where not all translations
would be generated by the time the corresponding .qrc was needed. Adding
a fugly add_dependencies(mod_common po) fixes this; however we may want to
find a cleaner way to properly express deps between the language files and the
qrc.

10 years agoProperly handle RPC calls that return void
Manuel Nickschas [Fri, 28 Mar 2014 22:26:53 +0000 (23:26 +0100)]
Properly handle RPC calls that return void

Qt5 loudly warns when trying to construct a QVariant from QMetaType::Void,
thus we should not do that. Instead, check for this case and use an invalid
QVariant instead. Works fine on both Qt4 and Qt5 that way.

10 years agoFix rendering of the sender column
Manuel Nickschas [Thu, 27 Mar 2014 22:20:24 +0000 (23:20 +0100)]
Fix rendering of the sender column

Turns out the compositing needed to be tweaked to actually behave
as desired. Senders are now properly rendered including the fade-out
effect on both Qt4 and Qt5.

10 years agoMerge pull request #68 from jpnurmi/build-date
Manuel Nickschas [Thu, 27 Mar 2014 20:45:13 +0000 (21:45 +0100)]
Merge pull request #68 from jpnurmi/build-date

Protocol::RegisterClient: add buildDate field

10 years agoMerge pull request #67 from jpnurmi/preset
Manuel Nickschas [Thu, 27 Mar 2014 20:44:54 +0000 (21:44 +0100)]
Merge pull request #67 from jpnurmi/preset

Move preset networks handling out of Network

10 years agoMerge pull request #66 from TheOneRing/snore
Manuel Nickschas [Thu, 27 Mar 2014 20:42:39 +0000 (21:42 +0100)]
Merge pull request #66 from TheOneRing/snore

Fixed detection of snore for Qt4/Qt5

10 years agoProtocol::RegisterClient: add buildDate field 68/head
J-P Nurmi [Thu, 27 Mar 2014 19:15:22 +0000 (20:15 +0100)]
Protocol::RegisterClient: add buildDate field

This kills the dependency from DataStreamPeer to Quassel::buildInfo().

10 years agoMove preset networks handling out of Network 67/head
J-P Nurmi [Wed, 26 Mar 2014 23:17:41 +0000 (00:17 +0100)]
Move preset networks handling out of Network

This moves highly application specific functionality out of Network
and makes it possible to re-use Quassel's code base for implementing
the Quassel protocol in external applications.

10 years agoMove the PeerPtr declaration out of types.h
Manuel Nickschas [Wed, 26 Mar 2014 21:03:21 +0000 (22:03 +0100)]
Move the PeerPtr declaration out of types.h

This belongs in peer.h instead, since types.h is included in lots
of places that should not drag the peer deps in. Also, this caused
problems (circular deps?) when building the OSX notification backend.

10 years agoFixed detection of snore for Qt4/Qt5 66/head
Patrick von Reth [Wed, 26 Mar 2014 20:16:01 +0000 (21:16 +0100)]
Fixed detection of snore for Qt4/Qt5

10 years agoMerge pull request #64 from TheOneRing/warnings
Manuel Nickschas [Wed, 26 Mar 2014 19:42:29 +0000 (20:42 +0100)]
Merge pull request #64 from TheOneRing/warnings

silence some warnings

10 years agoUpdate quassel.pot
Daniel Albers [Tue, 25 Mar 2014 21:56:13 +0000 (22:56 +0100)]
Update quassel.pot

10 years agoUpdate translations from Transifex
Daniel Albers [Wed, 19 Feb 2014 04:00:37 +0000 (05:00 +0100)]
Update translations from Transifex

  25507 translated messages

Many thanks to:
 - fi: Larso <larso@gmx.com>
 - tr: volkangezer <volkangezer@gmail.com>
 - uk: Yuri Chornoivan <yurchor@ukr.net>, Daniel Albers <daniel@lbe.rs>
 - pt_BR: André Marcelo Alvarenga <alvarenga@kde.org>

10 years agoUse the raster rendering engine by default on OSX
Manuel Nickschas [Tue, 25 Mar 2014 22:13:21 +0000 (23:13 +0100)]
Use the raster rendering engine by default on OSX

Seems like using the raster engine fixes performance issues on OSX,
and there seem to be no noticeable side-effects compared to native
rendering. So let's use this by default.

If you notice issues, please let us know. Also, you can always enforce
native rendering via command line:

open Quassel\ Client.app -W --args -graphicssystem native

Thanks to rikai for figuring this out!

10 years agoUnnecessary forward declaration of CoreSession.
K. Ernest (iFire) Lee [Mon, 10 Feb 2014 02:29:43 +0000 (18:29 -0800)]
Unnecessary forward declaration of CoreSession.

10 years agoMake the web preview build on Qt4 again
Manuel Nickschas [Tue, 25 Mar 2014 21:15:13 +0000 (22:15 +0100)]
Make the web preview build on Qt4 again

Prefixing the includes with the Qt module broke things for Qt4. It's
not needed anyway, so just remove the prefix.

10 years agoWebkit changed location and scale() is gone.
K. Ernest (iFire) Lee [Sun, 9 Feb 2014 21:57:30 +0000 (13:57 -0800)]
Webkit changed location and scale() is gone.

Webkit's include location changed and scale() is replaced by transform().

10 years agoProperly find WebKit for Qt5
Manuel Nickschas [Tue, 25 Mar 2014 20:51:41 +0000 (21:51 +0100)]
Properly find WebKit for Qt5

It's WebKit, not Webkit.

10 years agoQTreeView::dataChanged() signature changed in Qt5
Manuel Nickschas [Mon, 24 Mar 2014 23:15:47 +0000 (00:15 +0100)]
QTreeView::dataChanged() signature changed in Qt5

10 years agoAdd missing include
Manuel Nickschas [Mon, 24 Mar 2014 23:14:57 +0000 (00:14 +0100)]
Add missing include

10 years agoQDesktopServices -> QStandardPaths
Manuel Nickschas [Mon, 24 Mar 2014 23:14:34 +0000 (00:14 +0100)]
QDesktopServices -> QStandardPaths

10 years agoQSslCertificate::subjectInfo() returns a QStringList in Qt5
Manuel Nickschas [Mon, 24 Mar 2014 23:13:42 +0000 (00:13 +0100)]
QSslCertificate::subjectInfo() returns a QStringList in Qt5

10 years agoUse QSslCertificate::isNull() instead of isValid() in IdentityEditWidget
Manuel Nickschas [Mon, 24 Mar 2014 23:11:39 +0000 (00:11 +0100)]
Use QSslCertificate::isNull() instead of isValid() in IdentityEditWidget

The intention is to check if the certificate could be loaded, and isNull()
is actually the right thing to do. Saves us from dealing with the no-longer
existing isValid() in Qt5, too.

10 years agoQSslCertificate::{subject,issuer}Info() returns a QStringList in Qt5
Manuel Nickschas [Mon, 24 Mar 2014 21:59:37 +0000 (22:59 +0100)]
QSslCertificate::{subject,issuer}Info() returns a QStringList in Qt5

This requires changes in SslInfoDlg. To simplify handling the API differences,
we use small wrappers that join the string lists for Qt5.

10 years agoQSslCertificate::isValid() no longer exists in Qt5
Manuel Nickschas [Mon, 24 Mar 2014 21:28:16 +0000 (22:28 +0100)]
QSslCertificate::isValid() no longer exists in Qt5

Qt4's isValid() checked for the date range and if the cert is blacklisted.
In Qt5, these two checks need to be done explicitly.

10 years agoqVariantCanConvert is deprecated
Bas Pape [Sun, 21 Apr 2013 11:19:44 +0000 (13:19 +0200)]
qVariantCanConvert is deprecated

10 years agoQHeaderView::setResizeMode is deprecated in Qt 5
Bas Pape [Sat, 20 Apr 2013 22:26:21 +0000 (00:26 +0200)]
QHeaderView::setResizeMode is deprecated in Qt 5

10 years agoLogging changed in Qt 5; use QtMessageHandler
Bas Pape [Sat, 20 Apr 2013 22:04:41 +0000 (00:04 +0200)]
Logging changed in Qt 5; use QtMessageHandler

10 years agoqVariantValue is deprecated in Qt 5.0
Bas Pape [Sat, 20 Apr 2013 21:45:10 +0000 (23:45 +0200)]
qVariantValue is deprecated in Qt 5.0

10 years agosetAcceptsHoverEvents is deprecated in Qt 5.
Bas Pape [Sat, 20 Apr 2013 21:39:14 +0000 (23:39 +0200)]
setAcceptsHoverEvents is deprecated in Qt 5.

setAcceptsHoverEvents has been around since 4.4

10 years agosetAlphaChannel is deprecated in Qt 5.
Bas Pape [Sat, 20 Apr 2013 21:33:06 +0000 (23:33 +0200)]
setAlphaChannel is deprecated in Qt 5.

With the default CompositionMode this should work too.

10 years agoQKeySequence's int operator is deprecated
Bas Pape [Sat, 20 Apr 2013 12:48:08 +0000 (14:48 +0200)]
QKeySequence's int operator is deprecated

operator int returns the first key in the sequence, so just use that
one directly.

10 years agoNo more posF in Qt 5; use the new localPos
Bas Pape [Sat, 20 Apr 2013 12:21:06 +0000 (14:21 +0200)]
No more posF in Qt 5; use the new localPos

10 years agoreset is deprecated since Qt 5.0
Bas Pape [Sat, 20 Apr 2013 11:46:29 +0000 (13:46 +0200)]
reset is deprecated since Qt 5.0

10 years agoPrevent unused-but-set warnings ifndef QT_NO_DEBUG
Bas Pape [Sat, 20 Apr 2013 11:37:23 +0000 (13:37 +0200)]
Prevent unused-but-set warnings ifndef QT_NO_DEBUG

10 years agoQt::escape moved to QString::toHtmlEscaped in Qt 5
Bas Pape [Sat, 20 Apr 2013 11:24:34 +0000 (13:24 +0200)]
Qt::escape moved to QString::toHtmlEscaped in Qt 5

10 years agoChange Q_WS_* to Q_OS_*
Manuel Nickschas [Mon, 24 Mar 2014 20:43:45 +0000 (21:43 +0100)]
Change Q_WS_* to Q_OS_*

The Q_WS_{WIN,MAC} macros have been deprecated since Qt 4.3 or so,
and replaces by the corresponding Q_OS_* macros. Since Qt5 does not
support them anymore at all, let's globally change those to the "new"
version.

Also change Q_OS_WIN32 to just Q_OS_WIN; while the former is supposed to
be defined on all supported Windows platforms including Win64, it's still
a bit confusing.

10 years agoSignature of QTcpServer::incomingConnection() changed in Qt5
Manuel Nickschas [Mon, 24 Mar 2014 20:05:54 +0000 (21:05 +0100)]
Signature of QTcpServer::incomingConnection() changed in Qt5

10 years agoCan't forward-declare meta types in Qt5
Manuel Nickschas [Mon, 24 Mar 2014 20:00:44 +0000 (21:00 +0100)]
Can't forward-declare meta types in Qt5

10 years agoReplace {from,to}Ascii with {from,to}Latin1
K. Ernest (iFire) Lee [Sun, 9 Feb 2014 19:43:56 +0000 (11:43 -0800)]
Replace {from,to}Ascii with {from,to}Latin1

These have been deprecated since Qt 5.0, and rather than use
{from,to}Local8Bit I've decided to match the original functionality.

10 years agoRemove the useless coreeventmanager.cpp again
Manuel Nickschas [Mon, 24 Mar 2014 19:52:12 +0000 (20:52 +0100)]
Remove the useless coreeventmanager.cpp again

Was pulled in by applying harryF's patch, but removed from mainline
earlier.

10 years agoQt5 fixes
Harald Fernengel [Thu, 16 Aug 2012 08:07:31 +0000 (10:07 +0200)]
Qt5 fixes

Mostly due to the metatobject changes. Also, for some reason, my
cmake on the mac refused to create a moc file for coreeventmanager
unless there's a *.cpp file

10 years agoProperly handle DBusMenuQt in the build system
Manuel Nickschas [Mon, 24 Mar 2014 23:18:45 +0000 (00:18 +0100)]
Properly handle DBusMenuQt in the build system

This library ships a CMake config file these days, so we can remove
our own find script (which was no longer used anyway). Also, we need to
treat it as an imported target, there's no dbusmenu-qt_LIBRARIES...

10 years agoClean up and fix data/CMakeLists.txt
Manuel Nickschas [Mon, 24 Mar 2014 18:24:57 +0000 (19:24 +0100)]
Clean up and fix data/CMakeLists.txt

This was forgotten during the recent changes and still referred to
HAVE_KDE, thus failing now. Taking the opportunity to clean up this
ancient cruft as well (those conditionals...)

10 years agoFix handling the QtMain module on Windows
Manuel Nickschas [Sun, 23 Mar 2014 22:33:00 +0000 (23:33 +0100)]
Fix handling the QtMain module on Windows

Turns out that the QtMain module can't be used in qt4_use_modules,
and we should just add the library to our targets.

10 years agoImprove the handling of Qt5 modules in the build system
Manuel Nickschas [Sun, 23 Mar 2014 22:02:03 +0000 (23:02 +0100)]
Improve the handling of Qt5 modules in the build system

If a required Qt5 module is not available by the time it is needed,
CMake throws a rather fugly backtrace with a confusing error message.
To avoid this, we now check for all required Qt5 modules by calling
find_package without REQUIRED, and setting the REQUIRED pacakge property.
That way, there will be no errors during configuration, the feature
summary correctly shows the packages as missing, and then bails out
at this point, which results in a much nicer user experience.

For this to work, we also need to show the feature summary before adding
the src/ subdirectory, as this will forcefully require the modules it needs.

Additionally, this commit fixes finding lconvert (and thus translation
support) for Qt5.

10 years agoFix SSL detection
Manuel Nickschas [Sun, 23 Mar 2014 20:28:28 +0000 (21:28 +0100)]
Fix SSL detection

As there is no easy way to check for QT_CONFIG with Qt5 and CMake,
and the way we did it for Qt4 is hackish at best, let's do it the
proper way and compile a short code snippet that checks for the
appropriate defines (QT_NO_OPENSSL for Qt4, and QT_NO_SSL for Qt5).

This should be the most robust way of figuring this out, and is rather
easy with CMake.

10 years agoUpdate INSTALL file
Manuel Nickschas [Sun, 23 Mar 2014 19:42:55 +0000 (20:42 +0100)]
Update INSTALL file

This hadn't been touched since 2007, and with all the recent build
system changes, I guess it made sense to adapt it to reality.

10 years agoRemove obsolete CMake options
Manuel Nickschas [Sun, 23 Mar 2014 18:46:58 +0000 (19:46 +0100)]
Remove obsolete CMake options

Now that the new dependency handling is in place, we can remove several
of the CMake options we used to have. If you don't want automagic
dependencies, and want to disable one even though it is installed, you
can use -DCMAKE_DISABLE_FIND_PACKAGE_Foo=TRUE for ignoring the Foo package.

10 years agoMake SSL and syslog support non-configurable
Manuel Nickschas [Sun, 23 Mar 2014 18:44:27 +0000 (19:44 +0100)]
Make SSL and syslog support non-configurable

Both features have no external dependencies; SSL support requires Qt
to be built with SSL support, and syslog support requires the existence
of the syslog.h header. It makes no sense to make this configurable,
as no additional libraries or other dependencies are pulled in.

Instead, just add them to the feature_summary depending on the prerequisites
being in place.

10 years agoCompletely rework the dependency handling in the build system
Manuel Nickschas [Sun, 23 Mar 2014 01:39:38 +0000 (02:39 +0100)]
Completely rework the dependency handling in the build system

Traditionally, optional build dependencies are handled in CMake via
offering options and conditionally searching for the needed packages.
This leads to having lots of options, boilerplate for telling the user
which features are enabled or not, unclear handling of automagic
dependencies, and so on.

These days, CMake offers a much nicer way: feature_summary() and friends.
To make use of this, one calls find_package unconditionally and then sets
properties on the package that tell CMake if the dependency is optional
or required, its purpose, a description of the package etc. At the end
of configuration, CMake then displays a nice summary of all the packages
searched for and (not) found, as well as other features.

Quassel now makes use of this modern way of specifying dependencies, replacing
most of the former options (they're still there, but unused now, and will
be removed soon). Note that one can still disable an optional dependency Foo by
passing -DCMAKE_DISABLE_FIND_PACKAGE_Foo=TRUE to CMake.

I also took the opportunity to radically clean up and fix how we handle
dependencies throughout the build system:

* We no longer set an extra CMake variable to indicate that a package was
  found, but use the Foo_FOUND variable directly
* Compile definitions and include directories are no longer set globally
  in the root CMakeLists.txt, but in the Quassel modules where they're
  actually needed; this should speed up compiling ever so slightly and
  generally make things much cleaner
* Libraries are now linked directly to the Quassel modules that use them,
  rather than to the executable. This prepares us for making the modules
  shared libraries at some point, and is anyway The Right Thing™ to do
* Fully support Qt5 in the build system, including finding the proper version
  of dependencies where appropriate and available

Note that the changes to the build system are not complete yet, and some things
may be broken now. Note also that while Qt5 is now supported in the build system,
the code itself still requires many changes to actually compile with Qt5,
so don't even try.

10 years agoFix finding a custom Qt4 via -DQT_PATH
Manuel Nickschas [Sun, 23 Mar 2014 01:33:48 +0000 (02:33 +0100)]
Fix finding a custom Qt4 via -DQT_PATH

This CMake option has recently been renamed from QT to QT_PATH; we
really should actually use the new name...

10 years agoRemove unnecessary include
Manuel Nickschas [Sun, 23 Mar 2014 01:30:19 +0000 (02:30 +0100)]
Remove unnecessary include

CoreApplication does not in any way depend on KApplication.

10 years agoDon't make EventType::KeyEvent depend on HAVE_QCA2
Manuel Nickschas [Sun, 23 Mar 2014 01:27:45 +0000 (02:27 +0100)]
Don't make EventType::KeyEvent depend on HAVE_QCA2

This enum value can be known even if we don't have encryption support.

10 years agoAdd a CMake wrapper for finding indicate-qt
Manuel Nickschas [Sun, 23 Mar 2014 01:15:12 +0000 (02:15 +0100)]
Add a CMake wrapper for finding indicate-qt

Because CMake's feature_summary works only with dependencies found
via find_package, it makes sense to have a wrapper around the
PkgConfig call used to find indicate-qt. This is very basic and does
not support all of the usual options (such as checking for a particular
version), but sufficient for our needs.

10 years agoBacktrace generation depends on the target system, not the host
Manuel Nickschas [Sat, 22 Mar 2014 18:30:21 +0000 (19:30 +0100)]
Backtrace generation depends on the target system, not the host

We were checking for CMAKE_HOST_WIN32 and CMAKE_HOST_UNIX for determining
which kind of backtrace generation support to build. However, this should
obviously depend on the target platform, not on the platform we build on.

So let's use WIN32 and UNIX instead.

10 years agoImprove the CMake option stuff
Manuel Nickschas [Thu, 20 Mar 2014 21:29:42 +0000 (22:29 +0100)]
Improve the CMake option stuff

We now use cmake_dependent_option() to express dependencies between
the various options that you can give to CMake for configuring Quassel;
for example, enabling KDE4 now forces some options to OFF regardless
of the user-selected value (which will, however, be preserved in case
KDE integration is disabled again later).

This also renames WITH_QT5 to USE_QT5 (and adds a USE_QT4, too); this seems
to have emerged as the standard way to select a Qt version for dual-Qt
packages. However, Qt4 is still selected by default unless you force Qt5
by setting the USE_QT5 flag. BTW, don't get your hopes up, Qt5 support is
still broken... Once it's working, we may select Qt5 as default for certain
platforms.

Additionally we renamed QT to QT_PATH to make the function of this flag
more clear.

10 years agoOops, left in some debug stuff...
Manuel Nickschas [Thu, 20 Mar 2014 21:25:10 +0000 (22:25 +0100)]
Oops, left in some debug stuff...

10 years agoMerge pull request #54 from Bombe/issue-1227
Manuel Nickschas [Thu, 20 Mar 2014 21:44:55 +0000 (22:44 +0100)]
Merge pull request #54 from Bombe/issue-1227

Only create the regular expression for content/sender matches once.

10 years agoOnly create the regular expression for content/sender matches once. 54/head
David ‘Bombe’ Roden [Sun, 2 Feb 2014 11:27:33 +0000 (12:27 +0100)]
Only create the regular expression for content/sender matches once.

Fixes #1227.

10 years agoDon't actually build miniz if we have zlib
Manuel Nickschas [Wed, 19 Mar 2014 20:08:08 +0000 (21:08 +0100)]
Don't actually build miniz if we have zlib

We don't use miniz if we have zlib; but it was still being built, because
we never actually set HAVE_ZLIB as a build system variable.

Use ZLIB_FOUND instead.

10 years agoSimplify handling of (dual-)Qt in the build system
Manuel Nickschas [Wed, 19 Mar 2014 20:00:07 +0000 (21:00 +0100)]
Simplify handling of (dual-)Qt in the build system

We've used a somewhat complex way to link the various targets to the
required Qt libraries (and use the correct defines and CFLAGS...), because
when that stuff was written, there were no target properties in CMake, and
thus it was not easily possible to build targets within the same scope with
different settings. Therefore, we couldn't use the QT_USE_FILE and had to
write our own library handling.

These days, target properties exist, and Qt5 came up with a nice way to attach
the needed properties based on the Qt modules in use: qt5_use_modules()
This was later backported to Qt4, too, replacing the old way of having to
include QT_USE_FILE which would then set global variables.

We now make use of this; because qt4_use_modules() only showed up in
CMake 2.8.10, we've copied that function. It will be used only if it's
not present in CMake proper.

As a bonus, I've also wrapped all the qt-related macros into functions
that do the check for the Qt version we want to build against, and select
the proper macro to call, thus removing lots of WITH_QT5 conditionals
from the rest of the build system. Note that Qt5 support is still incomplete,
anyway.

10 years agoEnable automoc
Manuel Nickschas [Mon, 17 Mar 2014 22:15:57 +0000 (23:15 +0100)]
Enable automoc

Finally we can make use of this very convenient CMake feature and have
the moc stuff handled automagically. No need to list the headers anymore
for feeding them into the long-deprecated qt4_wrap_cpp macro.

Also, this should compile a bit faster and lead to slightly better optimized
code, because automoc will combine all the generated moc stuff for a target
into a single translation unit.

Note that we could get rid of various empty .cpp files (where all the code
is in the header) by just adding the header to the sources list; that way,
automoc will pick them up. There is no need to have a dummy .cpp file for
that.

10 years agoMove compile settings into a separate CMake module
Manuel Nickschas [Mon, 17 Mar 2014 21:33:50 +0000 (22:33 +0100)]
Move compile settings into a separate CMake module

That stuff just clutters the main CMakeLists.txt and is better off
in a separate file.

10 years agoMove all CMake scripts one level up
Manuel Nickschas [Sun, 16 Mar 2014 22:33:41 +0000 (23:33 +0100)]
Move all CMake scripts one level up

Having them in cmake/modules/ just adds a pointless extra directory,
so let's move them directly into cmake/.

10 years agosilence some warnings 64/head
Patrick von Reth [Mon, 17 Mar 2014 15:31:49 +0000 (16:31 +0100)]
silence some warnings

10 years agoInstall current cmake in Travis CI environment
Daniel Albers [Sun, 16 Mar 2014 22:45:30 +0000 (23:45 +0100)]
Install current cmake in Travis CI environment

10 years agoDisable Github's Travis CI for now
Manuel Nickschas [Sun, 16 Mar 2014 22:27:09 +0000 (23:27 +0100)]
Disable Github's Travis CI for now

Since the Github build servers have only CMake 2.8.7, we can't build there
at the moment. We'll re-enable this once they upgrade their servers, or
alternatively if we decide that we can relax the CMake requirement a bit.

10 years agoDon't look recursively for a .git dir
Manuel Nickschas [Sun, 16 Mar 2014 21:00:49 +0000 (22:00 +0100)]
Don't look recursively for a .git dir

The original GetGitRevisionDescription.cmake script would look for
a .git dir recursively in the parent directories of its invocation;
while a nice feature, it may pick up an unrelated repository if there's
none in the Quassel directory. Because we know exactly where to find
our own .git if it's there at all, we can remove the recursion and
prevent this issue.

10 years agogenversion-B-GONE
Manuel Nickschas [Sun, 16 Mar 2014 20:42:51 +0000 (21:42 +0100)]
genversion-B-GONE

Back in the day, we wanted to have information about the git hash a
particular Quassel binary was built from in the About dialog, to allow
for diagnostic purposes. However, we didn't manage to retrieve that
kind of information using CMake alone (we're talking CMake 2.4 here, too);
so we came up with the hack to compile a small binary that would be run
at build time and called the git executable in order to write version
information into a file.

This is not particularly nice, as running random binaries at build time is
frowned upon and can cause problems in some setups, and of course we have
the overhead of building it first.

Meanwhile, we found a nice set of CMake macros created by Ryan Pavlik that
would retrieve that information purely running Git commands, making genversion
obsolete. Together with the configure_file feature of CMake, this allows us
to do this more elegantly.

So gone is genversion, and also the good old trusted version.inc file...

10 years agoUpdate README and COPYING-CMAKE-SCRIPTS
Manuel Nickschas [Sun, 16 Mar 2014 17:54:49 +0000 (18:54 +0100)]
Update README and COPYING-CMAKE-SCRIPTS

Just to make clear how to handle the files we bundle.

10 years agoUpdate currently bundled CMake scripts
Manuel Nickschas [Sun, 16 Mar 2014 16:45:10 +0000 (17:45 +0100)]
Update currently bundled CMake scripts

We still need to bundle some CMake scripts that are not part of a
standard CMake installation, and may not be present in particular
on non-UNIXy platforms (as e.g. Windows does not have the concept
of a system-wide CMake script location).

Let's use current versions of those.

10 years agoRemove obsolete CMake scripts
Manuel Nickschas [Sun, 16 Mar 2014 16:40:11 +0000 (17:40 +0100)]
Remove obsolete CMake scripts

We no longer need to bundle our own versions of FindOpenSSL and
FindPkgConfig, as recent CMake versions ship them.

10 years agoBump CMake version requirement to 2.8.9
Manuel Nickschas [Sun, 16 Mar 2014 16:14:49 +0000 (17:14 +0100)]
Bump CMake version requirement to 2.8.9

Time to modernize our build system, making use of all the fancy features
that have crept into CMake in the past few years. While 2.8.9 is by far not
the latest version, it is rather widely deployed in distros at this time and
thus seems to be a reasonable choice as a minimum requirement.