Commit 1e3b90b8 authored by Michael Pyne's avatar Michael Pyne

Remove Kdelibs4Support.

This required a wide assortment of fixes, including deleting
needless #include <koldfoo.h> headers, some minor additional porting
tasks, and adding in includes that were previously only implicitly
included.
parent 4e13f805
...@@ -20,8 +20,8 @@ include(ECMQtDeclareLoggingCategory) ...@@ -20,8 +20,8 @@ include(ECMQtDeclareLoggingCategory)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Gui Svg Network Test Widgets) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Gui Svg Network Test Widgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Completion Config GlobalAccel find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Completion Config GlobalAccel
I18n IconThemes DocTools TextWidgets XmlGui Wallet I18n IconThemes DocTools KIO JobWidgets Notifications TextWidgets XmlGui Wallet
WidgetsAddons WindowSystem KDELibs4Support) WidgetsAddons WindowSystem)
find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE) find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE)
find_package(Taglib 1.6 REQUIRED) find_package(Taglib 1.6 REQUIRED)
...@@ -165,8 +165,9 @@ endif() ...@@ -165,8 +165,9 @@ endif()
target_link_libraries(juk ${LIBMATH} Qt5::Gui Qt5::Svg Qt5::Widgets target_link_libraries(juk ${LIBMATH} Qt5::Gui Qt5::Svg Qt5::Widgets
Qt5::Network KF5::ConfigCore KF5::CoreAddons KF5::Completion KF5::GlobalAccel Qt5::Network KF5::ConfigCore KF5::CoreAddons KF5::Completion KF5::GlobalAccel
KF5::KIOCore KF5::KIOWidgets KF5::KIOFileWidgets KF5::JobWidgets KF5::Notifications
KF5::I18n KF5::IconThemes KF5::TextWidgets KF5::XmlGui KF5::WindowSystem KF5::I18n KF5::IconThemes KF5::TextWidgets KF5::XmlGui KF5::WindowSystem
KF5::WidgetsAddons KF5::Wallet KF5::KDELibs4Support Phonon::phonon4qt5 ${TAGLIB_LIBRARIES}) KF5::WidgetsAddons KF5::Wallet Phonon::phonon4qt5 ${TAGLIB_LIBRARIES})
if(TUNEPIMP_FOUND) if(TUNEPIMP_FOUND)
target_link_libraries(juk ${TUNEPIMP_LIBRARIES}) target_link_libraries(juk ${TUNEPIMP_LIBRARIES})
endif(TUNEPIMP_FOUND) endif(TUNEPIMP_FOUND)
......
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
#include "advancedsearchdialog.h" #include "advancedsearchdialog.h"
#include <kcombobox.h> #include <kcombobox.h>
#include <klocale.h> #include <KLocalizedString>
#include <kvbox.h>
#include <KStandardGuiItem> #include <KStandardGuiItem>
#include <QDialogButtonBox> #include <QDialogButtonBox>
......
...@@ -18,12 +18,10 @@ ...@@ -18,12 +18,10 @@
#include "cache.h" #include "cache.h"
#include "juk-exception.h" #include "juk-exception.h"
#include <kstandarddirs.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kconfig.h> #include <kconfig.h>
#include <klocale.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
#include <kglobal.h> #include <KLocalizedString>
#include <QDir> #include <QDir>
#include <QBuffer> #include <QBuffer>
......
...@@ -16,15 +16,13 @@ ...@@ -16,15 +16,13 @@
#include "collectionlist.h" #include "collectionlist.h"
#include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kmenu.h> #include <KConfigGroup>
#include <kconfig.h> #include <KSharedConfig>
#include <kconfiggroup.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kstandarddirs.h>
#include <ktoolbarpopupaction.h> #include <ktoolbarpopupaction.h>
#include <kdirwatch.h> #include <kdirwatch.h>
#include <KLocalizedString>
#include <QList> #include <QList>
#include <QDragMoveEvent> #include <QDragMoveEvent>
...@@ -32,6 +30,7 @@ ...@@ -32,6 +30,7 @@
#include <QApplication> #include <QApplication>
#include <QTimer> #include <QTimer>
#include <QTime> #include <QTime>
#include <QMenu>
#include <QClipboard> #include <QClipboard>
#include <QFileInfo> #include <QFileInfo>
#include <QHeaderView> #include <QHeaderView>
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include "coverdialog.h" #include "coverdialog.h"
#include <KLocalizedString>
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h>
#include <QTimer> #include <QTimer>
#include <QMenu> #include <QMenu>
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include "coverinfo.h" #include "coverinfo.h"
#include <kglobal.h>
#include <QApplication> #include <QApplication>
#include <QRegExp> #include <QRegExp>
#include <QLabel> #include <QLabel>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <QStandardPaths> #include <QStandardPaths>
#include <QUrl> #include <QUrl>
#include <kdemacros.h>
#include <kio/job.h> #include <kio/job.h>
#include "juk.h" #include "juk.h"
...@@ -275,7 +274,7 @@ void CoverManagerPrivate::loadCovers() ...@@ -275,7 +274,7 @@ void CoverManagerPrivate::loadCovers()
// don't do so again. Possible due to a coding error during 3.5 // don't do so again. Possible due to a coding error during 3.5
// development. // development.
if(KDE_ISLIKELY(!tracks.contains(path))) { if(Q_LIKELY(!tracks.contains(path))) {
++covers[(coverKey) id].refCount; // Another track using this. ++covers[(coverKey) id].refCount; // Another track using this.
tracks.insert(path, id); tracks.insert(path, id);
} }
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#ifndef JUK_COVERMANAGER_H #ifndef JUK_COVERMANAGER_H
#define JUK_COVERMANAGER_H #define JUK_COVERMANAGER_H
#include <ksharedptr.h>
#include <QObject> #include <QObject>
#include <QMimeData> #include <QMimeData>
#include <QString> #include <QString>
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#ifndef DBUS_COLLECTION_PROXY_H #ifndef DBUS_COLLECTION_PROXY_H
#define DBUS_COLLECTION_PROXY_H #define DBUS_COLLECTION_PROXY_H
#include <QtCore/QObject> #include <QObject>
#include <QtCore/QStringList> // Required for Q_CLASSINFO ? #include <QStringList> // Required for Q_CLASSINFO ?
class PlaylistCollection; class PlaylistCollection;
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
#include "ui_deletedialogbase.h" #include "ui_deletedialogbase.h"
#include <KStandardGuiItem> #include <KStandardGuiItem>
#include <klocale.h> #include <KLocalizedString>
#include <kiconloader.h> #include <KIconLoader>
#include <kconfig.h> #include <KConfig>
#include <kconfiggroup.h> #include <KConfigGroup>
#include <kglobal.h> #include <KSharedConfig>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QStringList> #include <QStringList>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <QFileDialog> #include <QFileDialog>
#include <QStandardPaths> #include <QStandardPaths>
#include <klocale.h>
#include "juk_debug.h" #include "juk_debug.h"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <QShowEvent> #include <QShowEvent>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <klocale.h> #include <KLocalizedString>
ExampleOptions::ExampleOptions(QWidget *parent) : ExampleOptions::ExampleOptions(QWidget *parent) :
QWidget(parent) QWidget(parent)
......
...@@ -258,7 +258,7 @@ QStringList FileHandle::properties() // static ...@@ -258,7 +258,7 @@ QStringList FileHandle::properties() // static
QString FileHandle::property(const QString &name) const QString FileHandle::property(const QString &name) const
{ {
return FileHandleProperties::property(*this, name.toAscii()); return FileHandleProperties::property(*this, name.toUtf8());
} }
const FileHandle &FileHandle::null() // static const FileHandle &FileHandle::null() // static
......
...@@ -20,16 +20,14 @@ ...@@ -20,16 +20,14 @@
#include <algorithm> #include <algorithm>
#include <kurlrequester.h> #include <KUrlRequester>
#include <kiconloader.h> #include <kiconloader.h>
#include <knuminput.h> #include <KLocalizedString>
#include <kio/job.h> #include <kio/job.h>
#include <kio/netaccess.h>
#include <kdesktopfile.h> #include <kdesktopfile.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kglobal.h> #include <KSharedConfig>
#include <klineedit.h> #include <klineedit.h>
#include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <QFile> #include <QFile>
...@@ -947,7 +945,7 @@ bool FileRenamer::moveFile(const QString &src, const QString &dest) ...@@ -947,7 +945,7 @@ bool FileRenamer::moveFile(const QString &src, const QString &dest)
// Move the file. // Move the file.
KIO::Job *job = KIO::file_move(srcURL, dstURL); KIO::Job *job = KIO::file_move(srcURL, dstURL);
return KIO::NetAccess::synchronousRun(job, 0); return job->exec();
} }
void FileRenamer::setFolderIcon(const QUrl &dstURL, const PlaylistItem *item) void FileRenamer::setFolderIcon(const QUrl &dstURL, const PlaylistItem *item)
......
...@@ -260,12 +260,12 @@ ...@@ -260,12 +260,12 @@
<customwidget> <customwidget>
<class>KUrlRequester</class> <class>KUrlRequester</class>
<extends>QFrame</extends> <extends>QFrame</extends>
<header>kurlrequester.h</header> <header>KUrlRequester</header>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>KComboBox</class> <class>KComboBox</class>
<extends>QComboBox</extends> <extends>QComboBox</extends>
<header>kcombobox.h</header> <header>KComboBox</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "filerenamerconfigdlg.h" #include "filerenamerconfigdlg.h"
#include "filerenamer.h" #include "filerenamer.h"
#include <klocale.h> #include <KLocalizedString>
FileRenamerConfigDlg::FileRenamerConfigDlg(QWidget *parent) FileRenamerConfigDlg::FileRenamerConfigDlg(QWidget *parent)
: QDialog(parent) : QDialog(parent)
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
#include "filerenameroptions.h" #include "filerenameroptions.h"
#include <klocale.h> #include <KLocalizedString>
#include <knuminput.h>
#include "juk_debug.h" #include "juk_debug.h"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <QTimer> #include <QTimer>
#include <KLocale> #include <KLocalizedString>
#include "collectionlist.h" #include "collectionlist.h"
#include "playermanager.h" #include "playermanager.h"
......
...@@ -17,18 +17,16 @@ ...@@ -17,18 +17,16 @@
#include "juk.h" #include "juk.h"
#include <kstatusbar.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kstandardaction.h> #include <kstandardaction.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
#include <kactionmenu.h> #include <kactionmenu.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kglobal.h> #include <KSharedConfig>
#include <kglobalaccel.h> #include <kglobalaccel.h>
#include <ktoolbarpopupaction.h> #include <ktoolbarpopupaction.h>
#include <knotification.h> #include <knotification.h>
#include <kdeversion.h>
#include <QIcon> #include <QIcon>
#include <QAction> #include <QAction>
...@@ -39,6 +37,7 @@ ...@@ -39,6 +37,7 @@
#include <QTime> #include <QTime>
#include <QTimer> #include <QTimer>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QStatusBar>
#include "slideraction.h" #include "slideraction.h"
#include "statuslabel.h" #include "statuslabel.h"
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
#include "keydialog.h" #include "keydialog.h"
#include "actioncollection.h" #include "actioncollection.h"
#include <kconfig.h> #include <KConfig>
#include <klocale.h> #include <KShortcutsEditor>
#include <kshortcutseditor.h> #include <KConfigGroup>
#include <kglobal.h> #include <KSharedConfig>
#include <kconfiggroup.h>
#include <KGlobalAccel> #include <KGlobalAccel>
#include <KLocalizedString>
#include <QAction> #include <QAction>
#include <QKeySequence> #include <QKeySequence>
......
...@@ -17,21 +17,21 @@ ...@@ -17,21 +17,21 @@
#include <QDomDocument> #include <QDomDocument>
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QNetworkReply> #include <QNetworkReply>
#include <QIcon>
#include <QAction> #include <QAction>
#include <QUrlQuery>
#include <KLocalizedString> #include <KLocalizedString>
#include <KActionCollection> #include <KActionCollection>
#include <KToggleAction> #include <KToggleAction>
#include <KConfigGroup> #include <KConfigGroup>
#include <QIcon> #include <KSharedConfig>
#include <kglobal.h>
#include "lyricswidget.h" #include "lyricswidget.h"
#include "tag.h" #include "tag.h"
#include "actioncollection.h" #include "actioncollection.h"
#include "juk_debug.h" #include "juk_debug.h"
LyricsWidget::LyricsWidget(QWidget* parent): QTextBrowser(parent), LyricsWidget::LyricsWidget(QWidget* parent): QTextBrowser(parent),
m_networkAccessManager(new QNetworkAccessManager), m_networkAccessManager(new QNetworkAccessManager),
m_lyricsCurrent(false) m_lyricsCurrent(false)
...@@ -75,12 +75,16 @@ void LyricsWidget::makeLyricsRequest() ...@@ -75,12 +75,16 @@ void LyricsWidget::makeLyricsRequest()
setHtml(i18n("<i>Loading...</i>")); setHtml(i18n("<i>Loading...</i>"));
// TODO time for https (as long as it doesn't break this)
QUrl listUrl("http://lyrics.wikia.com/api.php"); QUrl listUrl("http://lyrics.wikia.com/api.php");
listUrl.addQueryItem("action", "lyrics"); QUrlQuery listUrlQuery;
listUrl.addQueryItem("func", "getSong"); listUrlQuery.addQueryItem("action", "lyrics");
listUrl.addQueryItem("fmt", "xml"); listUrlQuery.addQueryItem("func", "getSong");
listUrl.addQueryItem("artist", m_playingFile.tag()->artist()); listUrlQuery.addQueryItem("fmt", "xml");
listUrl.addQueryItem("song", m_playingFile.tag()->title()); listUrlQuery.addQueryItem("artist", m_playingFile.tag()->artist());
listUrlQuery.addQueryItem("song", m_playingFile.tag()->title());
listUrl.setQuery(listUrlQuery);
m_title = m_playingFile.tag()->artist() + " &#8211; " + m_playingFile.tag()->title(); m_title = m_playingFile.tag()->artist() + " &#8211; " + m_playingFile.tag()->title();
connect(m_networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(receiveListReply(QNetworkReply*))); connect(m_networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(receiveListReply(QNetworkReply*)));
m_networkAccessManager->get(QNetworkRequest(listUrl)); m_networkAccessManager->get(QNetworkRequest(listUrl));
...@@ -117,13 +121,16 @@ void LyricsWidget::receiveListReply(QNetworkReply* reply) ...@@ -117,13 +121,16 @@ void LyricsWidget::receiveListReply(QNetworkReply* reply)
QString artist = document.elementsByTagName("artist").at(0).toElement().text(); QString artist = document.elementsByTagName("artist").at(0).toElement().text();
QString title = document.elementsByTagName("song").at(0).toElement().text(); QString title = document.elementsByTagName("song").at(0).toElement().text();
// TODO time for https (as long as it doesn't break this)
QUrl url("http://lyrics.wikia.com/api.php"); QUrl url("http://lyrics.wikia.com/api.php");
url.addQueryItem("action", "query"); QUrlQuery urlQuery;
url.addQueryItem("prop", "revisions"); urlQuery.addQueryItem("action", "query");
url.addQueryItem("rvprop", "content"); urlQuery.addQueryItem("prop", "revisions");
url.addQueryItem("format", "xml"); urlQuery.addQueryItem("rvprop", "content");
url.addQueryItem("titles", artist + ':' + title); urlQuery.addQueryItem("format", "xml");
urlQuery.addQueryItem("titles", artist + ':' + title);
url.setQuery(urlQuery);
connect(m_networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(receiveLyricsReply(QNetworkReply*))); connect(m_networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(receiveLyricsReply(QNetworkReply*)));
m_networkAccessManager->get(QNetworkRequest(url)); m_networkAccessManager->get(QNetworkRequest(url));
} }
......
...@@ -14,18 +14,17 @@ ...@@ -14,18 +14,17 @@
* this program. If not, see <http://www.gnu.org/licenses/>. * this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <kuniqueapplication.h> #include <KAboutData>
#include <KConfigBase>
#include <kaboutdata.h> #include <KConfig>
#include <kconfigbase.h> #include <KConfigGroup>
#include <kconfig.h> #include <KNotification>
#include <klocale.h> #include <KSharedConfig>
#include <kglobal.h> #include <KLocalizedString>
#include <kconfiggroup.h>
#include <knotification.h>
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QCommandLineOption> #include <QCommandLineOption>
#include <QApplication>
#include "juk.h" #include "juk.h"
......
...@@ -16,15 +16,17 @@ ...@@ -16,15 +16,17 @@
#include "mediafiles.h" #include "mediafiles.h"
#include <klocale.h> #include <KLocalizedString>
#include <kurl.h> #include <KIO/StatJob>
#include <kio/netaccess.h> #include <KJobWidgets>
#include <kmimetype.h>
#include <QWidget> #include <QWidget>
#include <QFile> #include <QFile>
#include <QUrl>
#include <QFileDialog> #include <QFileDialog>
#include <QStandardPaths> #include <QStandardPaths>
#include <QMimeType>
#include <QMimeDatabase>
#include <taglib.h> #include <taglib.h>
#include <taglib_config.h> #include <taglib_config.h>
...@@ -143,35 +145,35 @@ QString MediaFiles::savePlaylistDialog(const QString &playlistName, QWidget *par ...@@ -143,35 +145,35 @@ QString MediaFiles::savePlaylistDialog(const QString &playlistName, QWidget *par
TagLib::File *MediaFiles::fileFactoryByType(const QString &fileName) TagLib::File *MediaFiles::fileFactoryByType(const QString &fileName)
{ {
KMimeType::Ptr result = KMimeType::findByPath(fileName); QMimeDatabase db;
// FIXME mimetype no isvalid QMimeType result = db.mimeTypeForFile(fileName);
//if(!result->isValid()) if(!result.isValid())
// return 0; return nullptr;
TagLib::File *file(0); TagLib::File *file(nullptr);
QByteArray encodedFileName(QFile::encodeName(fileName)); QByteArray encodedFileName(QFile::encodeName(fileName));
if(result->is(mp3Type)) if(result.inherits(QLatin1String(mp3Type)))
file = new TagLib::MPEG::File(encodedFileName.constData()); file = new TagLib::MPEG::File(encodedFileName.constData());
else if(result->is(flacType)) else if(result.inherits(QLatin1String(flacType)))
file = new TagLib::FLAC::File(encodedFileName.constData()); file = new TagLib::FLAC::File(encodedFileName.constData());
else if(result->is(vorbisType)) else if(result.inherits(QLatin1String(vorbisType)))
file = new TagLib::Vorbis::File(encodedFileName.constData()); file = new TagLib::Vorbis::File(encodedFileName.constData());
#ifdef TAGLIB_WITH_ASF #ifdef TAGLIB_WITH_ASF
else if(result->is(asfType)) else if(result.inherits(QLatin1String(asfType)))
file = new TagLib::ASF::File(encodedFileName.constData()); file = new TagLib::ASF::File(encodedFileName.constData());
#endif #endif
#ifdef TAGLIB_WITH_MP4 #ifdef TAGLIB_WITH_MP4
else if(result->is(mp4Type) || result->is(mp4AudiobookType)) else if(result.inherits(QLatin1String(mp4Type)) || result.inherits(QLatin1String(mp4AudiobookType)))
file = new TagLib::MP4::File(encodedFileName.constData()); file = new TagLib::MP4::File(encodedFileName.constData());
#endif #endif
else if(result->is(mpcType)) else if(result.inherits(QLatin1String(mpcType)))
file = new TagLib::MPC::File(encodedFileName.constData()); file = new TagLib::MPC::File(encodedFileName.constData());
else if(result->is(oggflacType)) else if(result.inherits(QLatin1String(oggflacType)))