diff --git a/AUTHORS b/AUTHORS index 6a5076e..d629b84 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,11 +1,20 @@ +QMPDClient, an Qt-based MPD client. + Håvard Tautra Knutsen havtknut@tihlde.org + http://havtknut.tihlde.org/qmpdclient/ Main developer Voker57 voker57@gmail.com + http://bitcheese.net/wiki/QMPDClient Developer, qmpdclient-ne maintainer Roman (Ky6uk) Nuritdinov ky6uk.kun@gmail.com + http://github.com/Ky6uk/qmpdclient-ng Developer + +Marian Beermann + qmpdclient@enkore,de + Developer (Qt 5 port) diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index b65c2c9..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,313 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -find_package(Qt4 4.4.0 COMPONENTS QtCore QtGui QtNetwork QtXml QtXmlPatterns REQUIRED QtDBus) -if(UNIX) - if(NOT MAC) - find_package(X11 REQUIRED) - endif() -endif() - -SET (QT_USE_QTNETWORK TRUE) -SET (QT_USE_QTXMLPATTERNS TRUE) -SET (QT_USE_QTXML TRUE) - -if(WIN32) - SET (QT_USE_QTMAIN TRUE) -endif() - -if(NOT DEFINED VERSION) - find_program (GIT_CMD git) - execute_process (COMMAND "${GIT_CMD}" describe - OUTPUT_VARIABLE VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(NOT VERSION) - set(VERSION 1.2.2) - endif() - message (STATUS "Current version: ${VERSION}") -endif() - -set(NAMEVER "QMPDClient ${VERSION}") - -set(QMPDClient_srcs - src/aafilter.cpp - src/aboutdialog.cpp - src/abstractmodel.cpp - src/abstractview.cpp - src/albumview.cpp - src/artistview.cpp - src/clickablelabel.cpp - src/config.cpp - src/controlpanel.cpp - src/coverartdialog.cpp - src/directorymodel.cpp - src/directorypanel.cpp - src/directoryview.cpp - src/dynamicplaylist.cpp - src/fileview.cpp - src/headerview.cpp - src/iconmanager.cpp - src/idealbar.cpp - src/idealsplitter.cpp - src/lastfmsubmitter.cpp - src/libmpdclient.c - src/librarypanel.cpp - src/lineedit.cpp - src/lyricsdialog.cpp - src/mainwindow.cpp - src/metainfodialog.cpp - src/mpdcache.cpp - src/mpdconnection.cpp - src/mpd.cpp - src/mpddirectory.cpp - src/mpdentities.cpp - src/mpdoutput.cpp - src/mpdsong.cpp - src/mpdsonglist.cpp - src/mpdsongmodel.cpp - src/mpdsongview.cpp - src/mpdstats.cpp - src/mpdstatus.cpp - src/notifications.cpp - src/passivepopup.cpp - src/pausabletimer.cpp - src/playlistitemdelegate.cpp - src/playlistmodel.cpp - src/playlistpanel.cpp - src/playlistspanel.cpp - src/playlistsview.cpp - src/playlistview.cpp - src/plconview.cpp - src/plsfile.cpp - src/preferencesdialog.cpp - src/qmpdclient.cpp - src/radiopanel.cpp - src/radioview.cpp - src/reconnect.cpp - src/serverinfo.cpp - src/servermodel.cpp - src/shortcutmodel.cpp - src/shortcuts.cpp - src/shoutcastmodel.cpp - src/shoutcastpanel.cpp - src/shoutcastview.cpp - src/shoutcastfetcher.cpp - src/shoutcaststation.cpp - src/songview.cpp - src/stringlistmodel.cpp - src/stringlistview.cpp - src/tagguesser.cpp - src/tagmodel.cpp - src/timelabel.cpp - src/timeslider.cpp - src/trayicon.cpp - src/traysonginfo.cpp - src/verticalbutton.cpp) - -# src/qmpdclient_mac.cpp -# src/qmpdclient_win.cpp -# src/qmpdclient_x11.cpp -# src/notifications_dbus.cpp -# src/notifications_nodbus.cpp - -set(QMPDClient_hdrs - src/aafilter.h - src/aboutdialog.h - src/abstractmodel.h - src/abstractview_defn.h - src/abstractview.h - src/abstractview_impl.h - src/albumview.h - src/artistview.h - src/clickablelabel.h - src/config.h - src/controlpanel.h - src/coverartdialog.h - src/debug.h - src/directorymodel.h - src/directorypanel.h - src/directoryview.h - src/dynamicplaylist.h - src/fileview.h - src/headerview.h - src/iconmanager.h - src/idealbar.h - src/idealsplitter.h - src/lastfmsubmitter.h - src/libmpdclient.h - src/librarypanel.h - src/lineedit.h - src/lyricsdialog.h - src/macroexpander.h - src/mainwindow.h - src/metainfodialog.h - src/mpdcache.h - src/mpdcache_p.h - src/mpdconnection.h - src/mpddirectory.h - src/mpdentities.h - src/mpd.h - src/mpdoutput.h - src/mpd_p.h - src/mpdsong.h - src/mpdsonglist.h - src/mpdsongmodel.h - src/mpdsongview.h - src/mpdstats.h - src/mpdstatus.h - src/notifications.h - src/passivepopup.h - src/pausabletimer.h - src/playlistitemdelegate.h - src/playlistmodel.h - src/playlistpanel.h - src/playlistspanel.h - src/playlistsview.h - src/playlistview.h - src/plconview.h - src/plsfile.h - src/preferencesdialog.h - src/qmpdclient.h - src/radiopanel.h - src/radioview.h - src/reconnect.h - src/richtext.h - src/serverinfo.h - src/servermodel.h - src/shortcutmodel.h - src/shortcuts.h - src/shoutcastpanel.h - src/shoutcastview.h - src/shoutcastmodel.h - src/shoutcastfetcher.h - src/shoutcaststation.h - src/songview.h - src/stringlistmodel.h - src/stringlistview.h - src/tagguesser.h - src/tagmodel.h - src/timelabel.h - src/timeslider.h - src/trayicon.h - src/traysonginfo.h - src/verticalbutton.h) - -SET(QMPDClient_uis - ui/aboutdialog.ui - ui/addradiodialog.ui - ui/controlpanel.ui - ui/coverartdialog.ui - ui/directorypanel.ui - ui/librarypanel.ui - ui/lyricsdialog.ui - ui/mainwindow.ui - ui/metainfodialog.ui - ui/playlistpanel.ui - ui/playlistspanel.ui - ui/preferencesdialog.ui - ui/radiopanel.ui - ui/shoutcastpanel.ui) - -if(UNIX) - if(NOT MAC) - if(QT_QTDBUS_FOUND) - message(STATUS "QtDBus found") - SET (QT_USE_QTDBUS TRUE) - list(APPEND QMPDClient_srcs src/notifications_dbus.cpp) - list(APPEND QMPDClient_srcs src/qdbus_adaptor.cpp) - list(APPEND QMPDClient_hdrs src/qdbus_adaptor.h) - add_definitions("-DWITH_DBUS") - else() - message(STATUS "QtDBus not found") - list(APPEND QMPDClient_srcs src/notifications_nodbus.cpp) - endif() - list(APPEND QMPDClient_srcs src/qmpdclient_x11.cpp) - else() - list(APPEND QMPDClient_srcs src/notifications_nodbus.cpp - src/qmpdclient_mac.cpp) - endif() -endif() - -if(WIN32) - list(APPEND QMPDClient_srcs src/notifications_nodbus.cpp - src/qmpdclient_win.cpp icons/resource.rc) -endif() - -include(${QT_USE_FILE}) -qt4_wrap_cpp(QMPDClient_ppd_hdrs ${QMPDClient_hdrs}) -qt4_add_resources(QMPDClient_ppd_res qmpdclient.qrc) -qt4_wrap_ui(QMPDClient_ppd_uis ${QMPDClient_uis}) -include_directories (${CMAKE_CURRENT_BINARY_DIR} - src) - -SET (TRANSLATIONS - lang/cs_CZ.ts - lang/de_DE.ts - lang/es_ES.ts - lang/fr_FR.ts - lang/it_IT.ts - lang/nl_NL.ts - lang/nn_NO.ts - lang/no_NO.ts - lang/pt_BR.ts - lang/ru_RU.ts - lang/sv_SE.ts - lang/tr_TR.ts - lang/uk_UA.ts - lang/zh_CN.ts - lang/zh_TW.ts) - -SET (COMPILED_TRANSLATIONS - lang/cs_CZ.qm - lang/de_DE.qm - lang/es_ES.qm - lang/fr_FR.qm - lang/it_IT.qm - lang/nl_NL.qm - lang/nn_NO.qm - lang/no_NO.qm - lang/pt_BR.qm - lang/ru_RU.qm - lang/sv_SE.qm - lang/tr_TR.qm - lang/uk_UA.qm - lang/zh_CN.qm - lang/zh_TW.qm) - - -ADD_CUSTOM_COMMAND (OUTPUT - ${COMPILED_TRANSLATIONS} - COMMAND "${QT_LRELEASE_EXECUTABLE}" ${TRANSLATIONS} - DEPENDS ${TRANSLATIONS} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - -add_definitions(-DNAMEVER="${NAMEVER}" -DPREFIX="${CMAKE_INSTALL_PREFIX}" -DVERSION="${VERSION}") - -add_executable(qmpdclient ${QMPDClient_srcs} ${QMPDClient_ppd_hdrs} ${QMPDClient_ppd_uis} ${QMPDClient_ppd_res} ${COMPILED_TRANSLATIONS}) - -target_link_libraries(qmpdclient ${QT_LIBRARIES}) -if(UNIX) - if(NOT MAC) - target_link_libraries(qmpdclient ${X11_LIBRARIES}) - endif() -endif() -if(WIN32) - target_link_libraries(qmpdclient ws2_32) - set_target_properties(qmpdclient PROPERTIES WIN32_EXECUTABLE TRUE) -endif() - -if(UNIX) - install(TARGETS qmpdclient DESTINATION bin) - install(FILES qmpdclient.desktop DESTINATION share/applications) - install(FILES icons/64x64/qmpdclient.png DESTINATION share/icons/hicolor/64x64/apps/) - install(FILES icons/48x48/qmpdclient.png DESTINATION share/icons/hicolor/48x48/apps/) - install(FILES icons/22x22/qmpdclient.png DESTINATION share/icons/hicolor/22x22/apps/) - install(FILES icons/16x16/qmpdclient.png DESTINATION share/icons/hicolor/16x16/apps/) - install(FILES icons/svg/qmpdclient.svg DESTINATION share/icons/hicolor/scalable/apps/) - install(FILES ${COMPILED_TRANSLATIONS} DESTINATION share/QMPDClient/translations) -endif() -if(WIN32) - install(TARGETS qmpdclient DESTINATION .) - install(FILES ${COMPILED_TRANSLATIONS} DESTINATION translations) -endif() diff --git a/COPYING b/COPYING index 956c13c..f6e933c 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,7 @@ (c) 2005-2008, Håvard Tautra Knutsen (c) 2008-2009, Voker57 (c) 2009, Roman (Ky6uk) Nuritdinov +(c) 2013, Marian Beermann This program is distributed under the terms of the GPL v2. diff --git a/README b/README index 1290cf1..c9ee743 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -QMPDClient, an MPD client written in Qt 4. +QMPDClient, an MPD client written in Qt 5. (c) 2005-2008, Håvard Tautra Knutsen diff --git a/qmpdclient.pro b/qmpdclient.pro index 4a09b48..47c57f5 100644 --- a/qmpdclient.pro +++ b/qmpdclient.pro @@ -2,8 +2,8 @@ PREFIX = /usr/local # Most people need not muck about below here -#!contains(QT_MAJOR_VERSION, 4):error(QMPDClient requires Qt 4) -CONFIG += qt debug +# !contains(QT_MAJOR_VERSION, 4):error(QMPDClient requires Qt 4) +CONFIG += qt5 debug # addition ldflags for release build QMAKE_LFLAGS_RELEASE += -O2 -g0 -s @@ -11,14 +11,14 @@ QMAKE_LFLAGS_RELEASE += -O2 -g0 -s # CONFIG -= debug # Needed to avoid console on win32 TEMPLATE = app RESOURCES = qmpdclient.qrc -VERSION = 1.2.2 +VERSION = 1.3 DEFINES += NAMEVER='"\\"QMPDClient \ $$VERSION\\""' DEFINES += VERSION='"\\"$$VERSION\\""' INCLUDEPATH += src -QT += network xml xmlpatterns +QT += network xml xmlpatterns widgets x11extras -FORMS += ui/aboutdialog.ui \ +FORMS += \ ui/addradiodialog.ui \ ui/controlpanel.ui \ ui/coverartdialog.ui \ @@ -31,7 +31,8 @@ FORMS += ui/aboutdialog.ui \ ui/preferencesdialog.ui \ ui/radiopanel.ui \ ui/shoutcastpanel.ui \ - ui/lyricsdialog.ui + ui/lyricsdialog.ui \ + ui/aboutdialog.ui HEADERS += src/aafilter.h \ src/aboutdialog.h \ diff --git a/src/controlpanel.cpp b/src/controlpanel.cpp index 5543d33..7d8f989 100644 --- a/src/controlpanel.cpp +++ b/src/controlpanel.cpp @@ -112,7 +112,7 @@ void ControlPanel::setSong(const MPDSong &s) { const int titleWidth = isVisible() ? titleLabel->width() : width() - 200; // const int artistWidth = isVisible() ? artistLabel->width() : width() - 200; - QString title = elideRichText("

", s.title() , "

", titleWidth); + //QString title = elideRichText("

", s.title() , "

", titleWidth); QString artist = s.artist(); QString album = s.album(); @@ -123,7 +123,7 @@ void ControlPanel::setSong(const MPDSong &s) { else if (!album.isEmpty()) artist += QString("%1").arg(album); - titleLabel->setText(title); + titleLabel->setText(s.title()); artistLabel->setText(artist); if (Config::instance()->submitSongsToLastFm()) m_lastFm->setSong(s); diff --git a/src/directorymodel.cpp b/src/directorymodel.cpp index 1297f5f..cd6b59b 100644 --- a/src/directorymodel.cpp +++ b/src/directorymodel.cpp @@ -145,7 +145,8 @@ QModelIndex DirectoryModel::createIndex(int row, int col, const MPDDirectory &di void DirectoryModel::setRoot(const MPDDirectory &root) { m_root = root; - reset(); + beginResetModel(); + endResetModel(); } QStringList DirectoryModel::mimeTypes() const { diff --git a/src/headerview.cpp b/src/headerview.cpp index 219af74..99a9f5a 100644 --- a/src/headerview.cpp +++ b/src/headerview.cpp @@ -27,7 +27,7 @@ const int HEADER_FORMAT = 108; HeaderView::HeaderView(QWidget *p) : QHeaderView(Qt::Horizontal, p), m_menu(new QMenu(this)) { - setMovable(true); + setSectionsMovable(true); connect(Config::instance(), SIGNAL(autoResizeChanged(bool)), this, SLOT(autoResizeChanged(bool))); } @@ -40,7 +40,7 @@ void HeaderView::mouseReleaseEvent(QMouseEvent *e) { void HeaderView::autoResizeChanged(bool a) { if (!a) { - setResizeMode(QHeaderView::Interactive); + setSectionResizeMode(QHeaderView::Interactive); setStretchLastSection(true); return; } @@ -52,9 +52,9 @@ void HeaderView::autoResizeChanged(bool a) { continue; Column col = m_columns.at(i); if (col == TRACK || col == LENGTH || col == DATE) - setResizeMode(i, QHeaderView::ResizeToContents); + setSectionResizeMode(i, QHeaderView::ResizeToContents); else - setResizeMode(i, QHeaderView::Stretch); + setSectionResizeMode(i, QHeaderView::Stretch); } setUpdatesEnabled(true); diff --git a/src/lastfmsubmitter.cpp b/src/lastfmsubmitter.cpp index a9b6ea9..901b11e 100644 --- a/src/lastfmsubmitter.cpp +++ b/src/lastfmsubmitter.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -115,7 +116,7 @@ void LastFmSubmitter::scrobbleNp(MPDSong & s) { QUrl url(m_npUrl); QNetworkRequest request(url); request.setRawHeader("Content-Type", "application/x-www-form-urlencoded"); - m_netAccess->post(request, data.toAscii()); + m_netAccess->post(request, data.toLatin1()); } void LastFmSubmitter::scrobbleCurrent() { @@ -153,12 +154,12 @@ void LastFmSubmitter::scrobbleQueued() { ++i; } if (i>0) { - //qDebug() << "sending scrobble to " << m_subUrl.toAscii(); - //qDebug() << "data: " << data.toAscii(); + //qDebug() << "sending scrobble to " << m_subUrl.toLatin1(); + //qDebug() << "data: " << data.toLatin1(); QUrl url(m_subUrl); QNetworkRequest request(url); request.setRawHeader("Content-Type", "application/x-www-form-urlencoded"); - m_netAccess->post(request, data.toAscii()); + m_netAccess->post(request, data.toLatin1()); m_awaitingScrob = true; } } @@ -173,10 +174,10 @@ bool LastFmSubmitter::ensureHandshaked() { QByteArray LastFmSubmitter::getPasswordHash() { QByteArray passwordHash; if (Config::instance()->lastFmHashedPassword()) - passwordHash = Config::instance()->lastFmPassword().toAscii(); + passwordHash = Config::instance()->lastFmPassword().toLatin1(); else passwordHash = QCryptographicHash::hash( - Config::instance()->lastFmPassword().toAscii(), + Config::instance()->lastFmPassword().toLatin1(), QCryptographicHash::Md5).toHex(); //accomplish it with current time @@ -201,13 +202,15 @@ void LastFmSubmitter::doHandshake() { return; } QUrl hsUrl = handshakeUrl(); - hsUrl.addQueryItem("hs", "true"); - hsUrl.addQueryItem("p", "1.2.1"); - hsUrl.addQueryItem("c", "qmn"); - hsUrl.addQueryItem("v", VERSION); - hsUrl.addQueryItem("u", Config::instance()->lastFmUsername()); - hsUrl.addQueryItem("t", QString::number(time(NULL))); - hsUrl.addQueryItem("a", getPasswordHash().toHex()); + QUrlQuery q; + q.addQueryItem("hs", "true"); + q.addQueryItem("p", "1.2.1"); + q.addQueryItem("c", "qmn"); + q.addQueryItem("v", VERSION); + q.addQueryItem("u", Config::instance()->lastFmUsername()); + q.addQueryItem("t", QString::number(time(NULL))); + q.addQueryItem("a", getPasswordHash().toHex()); + hsUrl.setQuery(q); m_netAccess->get(QNetworkRequest(hsUrl)); //qDebug() << "handshake sent to " << hsUrl.toString(); @@ -228,8 +231,10 @@ void LastFmSubmitter::gotNetReply(QNetworkReply * reply) { if(data.size()==0) return; QUrl reqUrl = reply->url(); - reqUrl.setQueryItems(QList >()); - //qDebug( (QString("reply from ")+reqUrl.toString()).toAscii().data()); + QUrlQuery q; + q.setQueryItems(QList >()); + reqUrl.setQuery(q); + //qDebug( (QString("reply from ")+reqUrl.toString()).toLatin1().data()); bool handled= false; // Is this is a handshake reply? @@ -242,7 +247,7 @@ void LastFmSubmitter::gotNetReply(QNetworkReply * reply) { m_session=data[1]; m_npUrl=data[2]; m_subUrl=data[3]; - //qDebug( (QString("hsake result: npurl: ")+m_npUrl+" suburl: "+m_subUrl).toAscii().data()); + //qDebug( (QString("hsake result: npurl: ")+m_npUrl+" suburl: "+m_subUrl).toLatin1().data()); if(m_npPending) sendNowPlaying(); } else if(data[0]=="BADAUTH") diff --git a/src/mpdcache.cpp b/src/mpdcache.cpp index 90f6a3b..85bb1ea 100644 --- a/src/mpdcache.cpp +++ b/src/mpdcache.cpp @@ -270,7 +270,7 @@ void MPDCache::deletePlaylist(const QString &playlistName) { mpd_beginList(); foreach(MPDSong s, d->playlistMap.keys()) { - mpd_call(MPDCache::deletePlaylists, Rm, playlistName.toAscii()); + mpd_call(MPDCache::deletePlaylists, Rm, playlistName.toLatin1()); } mpd_endList(); diff --git a/src/mpdsongmodel.cpp b/src/mpdsongmodel.cpp index e58045f..0bd4a30 100644 --- a/src/mpdsongmodel.cpp +++ b/src/mpdsongmodel.cpp @@ -146,7 +146,8 @@ void MPDSongModel::filter() { m_visible << s; } } - reset(); + beginResetModel(); + endResetModel(); } void MPDSongModel::sort(int column, Qt::SortOrder order) { diff --git a/src/mpdsongview.cpp b/src/mpdsongview.cpp index 4abc88b..68e22b2 100644 --- a/src/mpdsongview.cpp +++ b/src/mpdsongview.cpp @@ -47,7 +47,7 @@ void MPDSongView::setHeaderView(HeaderView *header) { void MPDSongView::setSongs(const MPDSongList &songs) { Q_ASSERT(m_model); m_model->setSongs(songs); - if (header()->isClickable()) + if (header()->sectionsClickable()) m_model->sort(header()->sortIndicatorSection(), header()->sortIndicatorOrder()); } diff --git a/src/playlistmodel.cpp b/src/playlistmodel.cpp index 0afe81b..26f5698 100644 --- a/src/playlistmodel.cpp +++ b/src/playlistmodel.cpp @@ -34,7 +34,8 @@ PlaylistModel::PlaylistModel(QObject *p) : MPDSongModel(p, 0), void PlaylistModel::setPattern(const QString &p) { m_pattern = p; - reset(); + beginResetModel(); + endResetModel(); } QString PlaylistModel::pattern() const { @@ -118,7 +119,8 @@ void PlaylistModel::setFilter(const QString &a) { void PlaylistModel::filter() { if (m_filter.isEmpty()) { m_visible = m_all; - reset(); + beginResetModel(); + endResetModel(); return; } @@ -137,7 +139,8 @@ void PlaylistModel::filter() { || s.time().contains(m_filter)) m_visible << s; } - reset(); + beginResetModel(); + endResetModel(); } /* diff --git a/src/preferencesdialog.cpp b/src/preferencesdialog.cpp index f0c811e..5f5afe1 100644 --- a/src/preferencesdialog.cpp +++ b/src/preferencesdialog.cpp @@ -129,9 +129,9 @@ void PreferencesDialog::initCategoryList() { } void PreferencesDialog::initConnectionPage() { - serverList->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + serverList->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); serverList->verticalHeader()->setDefaultSectionSize(fontMetrics().height()); - serverList->verticalHeader()->setResizeMode(QHeaderView::Fixed); + serverList->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); serverList->verticalHeader()->hide(); serverList->setModel(d->serverModel = new ServerModel(this)); @@ -388,9 +388,9 @@ void PreferencesDialog::initNotificationsPage() { } void PreferencesDialog::initShortcutPage() { - shortcutList->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + shortcutList->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); shortcutList->verticalHeader()->setDefaultSectionSize(fontMetrics().height()); - shortcutList->verticalHeader()->setResizeMode(QHeaderView::Fixed); + shortcutList->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); shortcutList->verticalHeader()->hide(); ShortcutModel *model = new ShortcutModel(this); @@ -664,7 +664,7 @@ void PreferencesDialog::styleChanged(QListWidgetItem *i) { void PreferencesDialog::hashLastFmPassword() { lastFmMd5PasswordRadio->setChecked(true); - lastFmPasswordEdit->setText(QCryptographicHash::hash(lastFmPasswordEdit->text().toAscii(), QCryptographicHash::Md5).toHex()); + lastFmPasswordEdit->setText(QCryptographicHash::hash(lastFmPasswordEdit->text().toLatin1(), QCryptographicHash::Md5).toHex()); } void PreferencesDialog::setLastFmSlider(int value) { diff --git a/src/qmpdclient.cpp b/src/qmpdclient.cpp index cd6e468..b35b55c 100644 --- a/src/qmpdclient.cpp +++ b/src/qmpdclient.cpp @@ -43,6 +43,7 @@ QMPDClient::QMPDClient(int &argc, char **argv) : QApplication(argc, argv), m_mainWindow(0), m_translator(0), m_qtTranslator(0) { + setObjectName("qmpdclient"); setApplicationName("QMPDClient"); setOrganizationName("QMPDClient"); diff --git a/src/qmpdclient.h b/src/qmpdclient.h index df0c5b0..d4e4b60 100644 --- a/src/qmpdclient.h +++ b/src/qmpdclient.h @@ -23,6 +23,7 @@ #include #include #include +#include class MainWindow; class QTranslator; @@ -32,10 +33,10 @@ class QMPDClient : public QApplication { public: QMPDClient(int &, char **); ~QMPDClient(); -#ifdef Q_WS_X11 - bool x11EventFilter(XEvent *); -#else - bool eventFilter(QObject *, QEvent *); + + bool eventFilter(QObject *, QEvent *); +#ifdef Q_OS_LINUX + bool x11EventFilter(void *); #endif #ifdef Q_WS_WIN bool winEventFilter(MSG *, long *); diff --git a/src/qmpdclient_x11.cpp b/src/qmpdclient_x11.cpp index 6d426fa..775a50f 100644 --- a/src/qmpdclient_x11.cpp +++ b/src/qmpdclient_x11.cpp @@ -70,11 +70,11 @@ void QMPDClient::ungrabKeys() { XUngrabKey(dpy, XF86AUDIO_VOLDN, 0, rootWindowId); } -bool QMPDClient::x11EventFilter(XEvent *xevent) { +bool QMPDClient::x11EventFilter(void *xevent) { Q_ASSERT(m_mainWindow); XKeyEvent *keyevent = (XKeyEvent *)xevent; - if (xevent->type != KeyRelease) + if (keyevent->type != KeyRelease) return false; switch (keyevent->keycode) { diff --git a/src/radioview.cpp b/src/radioview.cpp index 52b2022..c6547ab 100644 --- a/src/radioview.cpp +++ b/src/radioview.cpp @@ -77,7 +77,7 @@ void RadioView::newStation() { void RadioView::connected() { Q_ASSERT(m_model); m_model->setSongs(Config::instance()->radioStations()); - if (header()->isClickable()) + if (header()->sectionsClickable()) m_model->sort(header()->sortIndicatorSection(), header()->sortIndicatorOrder()); emit toggleNewAction(true); } diff --git a/src/servermodel.cpp b/src/servermodel.cpp index 681acfb..bebaaa2 100644 --- a/src/servermodel.cpp +++ b/src/servermodel.cpp @@ -113,7 +113,8 @@ int ServerModel::rowCount(const QModelIndex &index) const { void ServerModel::addServer() { m_servers << ServerInfo("New server"); Config::instance()->setServers(m_servers); - reset(); + beginResetModel(); + endResetModel(); } int ServerModel::size() const { @@ -125,7 +126,8 @@ void ServerModel::deleteServer(const QModelIndex &in) { return; m_servers.removeAt(in.row()); Config::instance()->setServers(m_servers); - reset(); + beginResetModel(); + endResetModel(); } bool ServerModel::moveUp(const QModelIndex &idx) { diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp index 8116dba..48067b5 100644 --- a/src/shortcuts.cpp +++ b/src/shortcuts.cpp @@ -36,7 +36,7 @@ Shortcuts *Shortcuts::instance() { #define LOAD(GET, SET, OBJ) \ do { \ -Config::instance()->setOriginalShortcut(OBJ->objectName(), OBJ->GET()); \ + Config::instance()->setOriginalShortcut(OBJ->objectName(), OBJ->GET().toString()); \ OBJ->SET(Config::instance()->shortcut(OBJ->objectName())); \ m_objects << OBJ; \ } while (0) diff --git a/src/stringlistmodel.cpp b/src/stringlistmodel.cpp index 32a8d6d..6a7bddb 100644 --- a/src/stringlistmodel.cpp +++ b/src/stringlistmodel.cpp @@ -31,7 +31,8 @@ StringListModel::StringListModel(QObject *parent) : QAbstractListModel(parent), void StringListModel::setShowAll(bool a) { m_showAll = a; - reset(); + beginResetModel(); + endResetModel(); } bool StringListModel::showAll() const{ @@ -102,7 +103,8 @@ QStringList StringListModel::stringList() const { void StringListModel::setStringList(const QStringList &strings) { m_list = strings; - reset(); + beginResetModel(); + endResetModel(); } int StringListModel::rowCount(const QModelIndex &index) const { diff --git a/ui/aboutdialog.ui b/ui/aboutdialog.ui index 876c7de..6c10369 100644 --- a/ui/aboutdialog.ui +++ b/ui/aboutdialog.ui @@ -18,7 +18,16 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 @@ -26,7 +35,16 @@ 6 - + + 0 + + + 0 + + + 0 + + 0 @@ -64,7 +82,7 @@ - 3 + 0 @@ -74,7 +92,16 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 @@ -90,7 +117,16 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 @@ -106,7 +142,16 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 @@ -122,7 +167,16 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 @@ -137,7 +191,16 @@ 6 - + + 0 + + + 0 + + + 0 + + 0 @@ -164,8 +227,6 @@ - - - +