Commit 53acb618 authored by Kacper Kasper's avatar Kacper Kasper

Very dirty port to KF5. Builds and runs.

parent 5b6357f4
project(juk) project(juk)
set( CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
find_package( KDE4 REQUIRED ) cmake_minimum_required(VERSION 3.0)
include( KDE4Defaults )
include( MacroLibrary ) find_package(ECM REQUIRED NO_MODULE)
include( CheckIncludeFileCXX ) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CMakePushCheckState)
include(CheckIncludeFileCXX)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(FeatureSummary)
include(ECMInstallIcons)
include(ECMAddAppIcon)
find_package(Qt5 5.2 REQUIRED COMPONENTS Gui Svg Network Test Widgets)
find_package(KF5 REQUIRED COMPONENTS CoreAddons Completion I18n IconThemes DocTools TextWidgets XmlGui Wallet WindowSystem KDELibs4Support KDE4Support)
find_package(Phonon4Qt5 4.6.60 REQUIRED NO_MODULE)
find_package( Taglib 1.6 ) find_package( Taglib 1.6 )
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} ) include_directories( ${PHONON_INCLUDES} ${KDE4_INCLUDES} ${QT_INCLUDES} )
add_subdirectory( doc ) add_subdirectory( doc )
add_subdirectory( tests ) add_subdirectory( tests )
add_subdirectory( pics ) add_subdirectory( pics )
macro_optional_find_package(TunePimp) find_package(TunePimp)
macro_log_feature(TUNEPIMP_FOUND "TunePimp" "A library for developing MusicBrainz enabled tagging applications" "http://www.musicbrainz.org/products/tunepimp" FALSE "" "Provides MusicBrainz tagging in Juk.") set_package_properties(FEATURE PROPERTIES DESCRIPTION "A library for developing MusicBrainz enabled tagging applications" URL "http://www.musicbrainz.org/products/tunepimp" TYPE OPTIONAL PURPOSE "Provides MusicBrainz tagging in Juk.")
if(TUNEPIMP_FOUND) if(TUNEPIMP_FOUND)
set(HAVE_TUNEPIMP 1) set(HAVE_TUNEPIMP 1)
if(TUNEPIMP_FOUND_VERSION_4) if(TUNEPIMP_FOUND_VERSION_4)
...@@ -27,18 +40,18 @@ else(TUNEPIMP_FOUND) ...@@ -27,18 +40,18 @@ else(TUNEPIMP_FOUND)
set(HAVE_TUNEPIMP 0) set(HAVE_TUNEPIMP 0)
endif(TUNEPIMP_FOUND) endif(TUNEPIMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} -fPIC")
########### next target ############### ########### next target ###############
include_directories( ${TAGLIB_INCLUDES} ) include_directories( ${TAGLIB_INCLUDES} )
add_definitions(-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS -DQT_STL) add_definitions(-DQT_STL)
# Look for Ogg Opus support in taglib (not released yet) # Look for Ogg Opus support in taglib (not released yet)
macro_push_required_vars() cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${TAGLIB_INCLUDES}) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${TAGLIB_INCLUDES})
check_include_file_cxx(opusfile.h TAGLIB_HAS_OPUSFILE) check_include_file_cxx(opusfile.h TAGLIB_HAS_OPUSFILE)
macro_pop_required_vars() cmake_pop_check_state()
configure_file (config-juk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-juk.h ) configure_file (config-juk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-juk.h )
...@@ -117,13 +130,13 @@ set(juk_SRCS ${tunepimp_SRCS} ...@@ -117,13 +130,13 @@ set(juk_SRCS ${tunepimp_SRCS}
ktrm.cpp ktrm.cpp
viewmode.cpp ) viewmode.cpp )
qt4_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.collection.xml
dbuscollectionproxy.h DBusCollectionProxy ) dbuscollectionproxy.h DBusCollectionProxy )
qt4_add_dbus_adaptor( juk_SRCS org.kde.juk.player.xml playermanager.h PlayerManager) qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.player.xml playermanager.h PlayerManager)
qt4_add_dbus_adaptor( juk_SRCS org.kde.juk.search.xml searchwidget.h SearchWidget) qt5_add_dbus_adaptor( juk_SRCS org.kde.juk.search.xml searchwidget.h SearchWidget)
kde4_add_ui_files(juk_SRCS qt5_wrap_ui(juk_SRCS
filerenamerbase.ui filerenamerbase.ui
filerenameroptionsbase.ui filerenameroptionsbase.ui
directorylistbase.ui directorylistbase.ui
...@@ -135,14 +148,15 @@ kde4_add_ui_files(juk_SRCS ...@@ -135,14 +148,15 @@ kde4_add_ui_files(juk_SRCS
tageditor.ui tageditor.ui
) )
kde4_add_app_icon(juk_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-app-juk.png") file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-juk.png")
kde4_add_executable(juk ${juk_SRCS}) ecm_add_app_icon(juk_SRCS ICONS ${ICONS_SRCS})
add_executable(juk ${juk_SRCS})
if(NOT MSVC AND NOT ( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" ) ) if(NOT MSVC AND NOT ( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" ) )
set( LIBMATH m ) set( LIBMATH m )
endif(NOT MSVC AND NOT ( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" ) ) endif()
target_link_libraries(juk ${LIBMATH} ${KDE4_KHTML_LIBS} ${TAGLIB_LIBRARIES} ${KDE4_KDE3SUPPORT_LIBS} ${KDE4_PHONON_LIBS}) target_link_libraries(juk ${LIBMATH} Qt5::Gui Qt5::Svg Qt5::Widgets Qt5::Network KF5::CoreAddons KF5::Completion KF5::I18n KF5::IconThemes KF5::TextWidgets KF5::XmlGui KF5::WindowSystem KF5::Wallet KF5::KDELibs4Support KF5::KDE4Support ${PHONON_LIBRARY} ${KDE4_KHTML_LIBS} ${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)
...@@ -154,10 +168,10 @@ install(TARGETS juk ${INSTALL_TARGETS_DEFAULT_ARGS} ) ...@@ -154,10 +168,10 @@ install(TARGETS juk ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### install files ############### ########### install files ###############
install( PROGRAMS org.kde.juk.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) install( PROGRAMS org.kde.juk.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES juk.notifyrc jukui.rc jukui-rtl.rc DESTINATION ${DATA_INSTALL_DIR}/juk ) install( FILES juk.notifyrc jukui.rc jukui-rtl.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/juk )
install( FILES org.kde.juk.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo ) install( FILES org.kde.juk.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo )
install( FILES jukservicemenu.desktop DESTINATION install( FILES jukservicemenu.desktop DESTINATION
${SERVICES_INSTALL_DIR}/ServiceMenus ) ${SERVICES_INSTALL_DIR}/ServiceMenus )
install( FILES org.kde.juk.collection.xml org.kde.juk.player.xml org.kde.juk.search.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} ) install( FILES org.kde.juk.collection.xml org.kde.juk.player.xml org.kde.juk.search.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
kde4_install_icons( ${ICON_INSTALL_DIR} ) ecm_install_icons( ${ICON_INSTALL_DIR} )
...@@ -135,13 +135,15 @@ AdvancedSearchDialog::~AdvancedSearchDialog() ...@@ -135,13 +135,15 @@ AdvancedSearchDialog::~AdvancedSearchDialog()
// public slots // public slots
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
AdvancedSearchDialog::Result AdvancedSearchDialog::exec() //AdvancedSearchDialog::Result AdvancedSearchDialog::exec()
int AdvancedSearchDialog::exec()
{ {
return 0; // FIXME
Result r; Result r;
r.result = DialogCode(KDialog::exec()); r.result = DialogCode(KDialog::exec());
r.search = m_search; r.search = m_search;
r.playlistName = m_playlistName; r.playlistName = m_playlistName;
return r; //return r;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -48,7 +48,8 @@ public: ...@@ -48,7 +48,8 @@ public:
virtual ~AdvancedSearchDialog(); virtual ~AdvancedSearchDialog();
public slots: public slots:
Result exec(); //Result exec();
int exec();
protected slots: protected slots:
virtual void accept(); virtual void accept();
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include <kdebug.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
#include <kglobal.h>
#include <QDir> #include <QDir>
#include <QBuffer> #include <QBuffer>
...@@ -172,7 +173,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static ...@@ -172,7 +173,7 @@ void Cache::loadPlaylists(PlaylistCollection *collection) // static
qint32 sortColumn; qint32 sortColumn;
s >> sortColumn; s >> sortColumn;
if(playlist) if(playlist)
playlist->setSorting(sortColumn); playlist->model()->sort(sortColumn);
} }
} // while !s.atEnd() } // while !s.atEnd()
...@@ -269,7 +270,8 @@ void Cache::savePlaylists(const PlaylistList &playlists) ...@@ -269,7 +270,8 @@ void Cache::savePlaylists(const PlaylistList &playlists)
s << qint32(Normal) s << qint32(Normal)
<< *(*it); << *(*it);
} }
s << qint32((*it)->sortColumn()); //s << qint32((*it)->sortColumn());
s << 0;
} }
} }
......
...@@ -121,10 +121,11 @@ void CollectionList::completedLoadingCachedItems() ...@@ -121,10 +121,11 @@ void CollectionList::completedLoadingCachedItems()
if(config.readEntry("CollectionListSortAscending", true)) if(config.readEntry("CollectionListSortAscending", true))
order = Qt::AscendingOrder; order = Qt::AscendingOrder;
m_list->setSortOrder(order); // FIXME
m_list->setSortColumn(config.readEntry("CollectionListSortColumn", 1)); //m_list->setSortOrder(order);
//m_list->setSortColumn(config.readEntry("CollectionListSortColumn", 1));
m_list->sort(); //m_list->sort();
SplashScreen::finishedLoading(); SplashScreen::finishedLoading();
...@@ -153,7 +154,7 @@ void CollectionList::initialize(PlaylistCollection *collection) ...@@ -153,7 +154,7 @@ void CollectionList::initialize(PlaylistCollection *collection)
// public methods // public methods
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
CollectionListItem *CollectionList::createItem(const FileHandle &file, Q3ListViewItem *, bool) CollectionListItem *CollectionList::createItem(const FileHandle &file, QTreeWidgetItem *, bool)
{ {
// It's probably possible to optimize the line below away, but, well, right // It's probably possible to optimize the line below away, but, well, right
// now it's more important to not load duplicate items. // now it's more important to not load duplicate items.
...@@ -345,7 +346,8 @@ CollectionList::CollectionList(PlaylistCollection *collection) : ...@@ -345,7 +346,8 @@ CollectionList::CollectionList(PlaylistCollection *collection) :
this, SLOT(slotPopulateBackMenu())); this, SLOT(slotPopulateBackMenu()));
connect(action<KToolBarPopupAction>("back")->menu(), SIGNAL(triggered(QAction*)), connect(action<KToolBarPopupAction>("back")->menu(), SIGNAL(triggered(QAction*)),
this, SLOT(slotPlayFromBackMenu(QAction*))); this, SLOT(slotPlayFromBackMenu(QAction*)));
setSorting(-1); // Temporarily disable sorting to add items faster. //FIXME
//setSorting(-1); // Temporarily disable sorting to add items faster.
m_columnTags[PlaylistItem::ArtistColumn] = new TagCountDict; m_columnTags[PlaylistItem::ArtistColumn] = new TagCountDict;
m_columnTags[PlaylistItem::AlbumColumn] = new TagCountDict; m_columnTags[PlaylistItem::AlbumColumn] = new TagCountDict;
...@@ -358,8 +360,9 @@ CollectionList::CollectionList(PlaylistCollection *collection) : ...@@ -358,8 +360,9 @@ CollectionList::CollectionList(PlaylistCollection *collection) :
CollectionList::~CollectionList() CollectionList::~CollectionList()
{ {
KConfigGroup config(KGlobal::config(), "Playlists"); KConfigGroup config(KGlobal::config(), "Playlists");
config.writeEntry("CollectionListSortColumn", sortColumn()); //FIXME
config.writeEntry("CollectionListSortAscending", sortOrder() == Qt::AscendingOrder); //config.writeEntry("CollectionListSortColumn", sortColumn());
//config.writeEntry("CollectionListSortAscending", sortOrder() == Qt::AscendingOrder);
// In some situations the dataChanged signal from clearItems will cause observers to // In some situations the dataChanged signal from clearItems will cause observers to
// subsequently try to access a deleted item. Since we're going away just remove all // subsequently try to access a deleted item. Since we're going away just remove all
...@@ -387,9 +390,9 @@ void CollectionList::contentsDropEvent(QDropEvent *e) ...@@ -387,9 +390,9 @@ void CollectionList::contentsDropEvent(QDropEvent *e)
void CollectionList::contentsDragMoveEvent(QDragMoveEvent *e) void CollectionList::contentsDragMoveEvent(QDragMoveEvent *e)
{ {
if(e->source() != this) /*if(e->source() != this)
Playlist::contentsDragMoveEvent(e); Playlist::contentsDragMoveEvent(e);
else else*/
e->setAccepted(false); e->setAccepted(false);
} }
...@@ -474,6 +477,7 @@ void CollectionListItem::refresh() ...@@ -474,6 +477,7 @@ void CollectionListItem::refresh()
data()->cachedWidths.resize(columns); data()->cachedWidths.resize(columns);
for(int i = offset; i < columns; i++) { for(int i = offset; i < columns; i++) {
setData(i, Qt::DisplayRole, text(i));
int id = i - offset; int id = i - offset;
if(id != TrackNumberColumn && id != LengthColumn) { if(id != TrackNumberColumn && id != LengthColumn) {
// All columns other than track num and length need local-encoded data for sorting // All columns other than track num and length need local-encoded data for sorting
...@@ -497,21 +501,21 @@ void CollectionListItem::refresh() ...@@ -497,21 +501,21 @@ void CollectionListItem::refresh()
data()->metadata[id] = toLower; data()->metadata[id] = toLower;
} }
int newWidth = width(listView()->fontMetrics(), listView(), i); /*int newWidth = width(listView()->fontMetrics(), listView(), i);
if(newWidth != data()->cachedWidths[i]) if(newWidth != data()->cachedWidths[i])
playlist()->slotWeightDirty(i); playlist()->slotWeightDirty(i);
data()->cachedWidths[i] = newWidth; data()->cachedWidths[i] = newWidth;*/
} }
if(listView()->isVisible()) /*if(listView()->isVisible())
repaint(); repaint();*/
for(PlaylistItemList::Iterator it = m_children.begin(); it != m_children.end(); ++it) { for(PlaylistItemList::Iterator it = m_children.begin(); it != m_children.end(); ++it) {
(*it)->playlist()->update(); (*it)->playlist()->update();
(*it)->playlist()->dataChanged(); (*it)->playlist()->dataChanged();
if((*it)->listView()->isVisible()) /*if((*it)->treeWidget()->isVisible())
(*it)->repaint(); (*it)->repaint();*/
} }
CollectionList::instance()->dataChanged(); CollectionList::instance()->dataChanged();
...@@ -543,9 +547,9 @@ void CollectionListItem::updateCollectionDict(const QString &oldPath, const QStr ...@@ -543,9 +547,9 @@ void CollectionListItem::updateCollectionDict(const QString &oldPath, const QStr
void CollectionListItem::repaint() const void CollectionListItem::repaint() const
{ {
Q3ListViewItem::repaint(); /*QItemDelegate::repaint();
for(PlaylistItemList::ConstIterator it = m_children.constBegin(); it != m_children.constEnd(); ++it) for(PlaylistItemList::ConstIterator it = m_children.constBegin(); it != m_children.constEnd(); ++it)
(*it)->repaint(); (*it)->repaint();*/
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
CollectionListItem *lookup(const QString &file) const; CollectionListItem *lookup(const QString &file) const;
virtual CollectionListItem *createItem(const FileHandle &file, virtual CollectionListItem *createItem(const FileHandle &file,
Q3ListViewItem * = 0, QTreeWidgetItem * = 0,
bool = false); bool = false);
void emitVisibleColumnsChanged() { emit signalVisibleColumnsChanged(); } void emitVisibleColumnsChanged() { emit signalVisibleColumnsChanged(); }
......
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
}; };
CoverDialog::CoverDialog(QWidget *parent) : CoverDialog::CoverDialog(QWidget *parent) :
QWidget(parent, Qt::WType_Dialog) QWidget(parent, Qt::Dialog)
{ {
setupUi(this); setupUi(this);
......
...@@ -107,7 +107,6 @@ ...@@ -107,7 +107,6 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<includes> <includes>
<include location="local" >k3listview.h</include>
<include location="local" >klineedit.h</include> <include location="local" >klineedit.h</include>
<include location="local" >covericonview.h</include> <include location="local" >covericonview.h</include>
</includes> </includes>
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
struct CoverPopup : public QWidget struct CoverPopup : public QWidget
{ {
CoverPopup(const QPixmap &image, const QPoint &p) : CoverPopup(const QPixmap &image, const QPoint &p) :
QWidget(0, Qt::WDestructiveClose | Qt::WX11BypassWM) QWidget(0, Qt::WindowFlags(Qt::WA_DeleteOnClose | Qt::X11BypassWindowManagerHint))
{ {
QHBoxLayout *layout = new QHBoxLayout(this); QHBoxLayout *layout = new QHBoxLayout(this);
QLabel *label = new QLabel(this); QLabel *label = new QLabel(this);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <kiconloader.h> #include <kiconloader.h>
#include <kconfig.h> #include <kconfig.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kglobal.h>
#include <QStringList> #include <QStringList>
#include <QCheckBox> #include <QCheckBox>
...@@ -80,7 +81,7 @@ void DeleteWidget::slotShouldDelete(bool shouldDelete) ...@@ -80,7 +81,7 @@ void DeleteWidget::slotShouldDelete(bool shouldDelete)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
DeleteDialog::DeleteDialog(QWidget *parent) : DeleteDialog::DeleteDialog(QWidget *parent) :
KDialog(parent, Qt::WStyle_DialogBorder), KDialog(parent, Qt::MSWindowsFixedSizeDialogHint),
m_trashGuiItem(i18n("&Send to Trash"), "user-trash-full") m_trashGuiItem(i18n("&Send to Trash"), "user-trash-full")
{ {
setObjectName( QLatin1String("delete_dialog" )); setObjectName( QLatin1String("delete_dialog" ));
......
...@@ -79,11 +79,12 @@ DirectoryList::~DirectoryList() ...@@ -79,11 +79,12 @@ DirectoryList::~DirectoryList()
// public slots // public slots
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
DirectoryList::Result DirectoryList::exec() int DirectoryList::exec()
{ {
m_result.status = static_cast<DialogCode>(KDialog::exec()); m_result.status = static_cast<DialogCode>(KDialog::exec());
m_result.addPlaylists = m_base->importPlaylistsCheckBox->isChecked(); m_result.addPlaylists = m_base->importPlaylistsCheckBox->isChecked();
return m_result; //return m_result;
return 0;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
virtual ~DirectoryList(); virtual ~DirectoryList();
public slots: public slots:
Result exec(); int exec();
signals: signals:
void signalDirectoryAdded(const QString &directory); void signalDirectoryAdded(const QString &directory);
......
########### install files ############### ########### install files ###############
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR juk) kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR juk)
...@@ -57,7 +57,7 @@ DynamicPlaylist::DynamicPlaylist(const PlaylistList &playlists, ...@@ -57,7 +57,7 @@ DynamicPlaylist::DynamicPlaylist(const PlaylistList &playlists,
setName(name); setName(name);
setAllowDuplicates(false); setAllowDuplicates(false);
setSorting(columns() + 1); sortItems(columnCount() + 1, Qt::AscendingOrder);
for(PlaylistList::ConstIterator it = playlists.constBegin(); it != playlists.constEnd(); ++it) for(PlaylistList::ConstIterator it = playlists.constBegin(); it != playlists.constEnd(); ++it)
m_observers.append(new PlaylistDirtyObserver(this, *it)); m_observers.append(new PlaylistDirtyObserver(this, *it));
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#ifndef EXAMPLEOPTIONS_H #ifndef EXAMPLEOPTIONS_H
#define EXAMPLEOPTIONS_H #define EXAMPLEOPTIONS_H
#include <KUrl>
#include <qdialog.h> #include <qdialog.h>
#include <QHideEvent> #include <QHideEvent>
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <QPixmap> #include <QPixmap>
#include <QFrame> #include <QFrame>
#include <QTreeWidget> #include <QTreeWidget>
#include <QScrollBar>
#include "tag.h" #include "tag.h"
#include "filerenameroptions.h" #include "filerenameroptions.h"
...@@ -899,7 +900,7 @@ void FileRenamer::rename(const PlaylistItemList &items) ...@@ -899,7 +900,7 @@ void FileRenamer::rename(const PlaylistItemList &items)
if(itemMap.isEmpty() || ConfirmationDialog(map).exec() != QDialog::Accepted) if(itemMap.isEmpty() || ConfirmationDialog(map).exec() != QDialog::Accepted)
return; return;
KApplication::setOverrideCursor(Qt::waitCursor); KApplication::setOverrideCursor(Qt::WaitCursor);
for(QMap<QString, QString>::ConstIterator it = map.constBegin(); for(QMap<QString, QString>::ConstIterator it = map.constBegin();
it != map.constEnd(); ++it) it != map.constEnd(); ++it)
{ {
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <QVector> #include <QVector>
#include <QMap> #include <QMap>
#include <KUrl>
#include "ui_filerenamerbase.h" #include "ui_filerenamerbase.h"
#include "categoryreaderinterface.h" #include "categoryreaderinterface.h"
#include "tagrenameroptions.h" #include "tagrenameroptions.h"
......
...@@ -38,8 +38,8 @@ HistoryPlaylist::HistoryPlaylist(PlaylistCollection *collection) : ...@@ -38,8 +38,8 @@ HistoryPlaylist::HistoryPlaylist(PlaylistCollection *collection) :
m_timer->setSingleShot(true); m_timer->setSingleShot(true);
connect(m_timer, SIGNAL(timeout()), this, SLOT(slotCreateNewItem())); connect(m_timer, SIGNAL(timeout()), this, SLOT(slotCreateNewItem()));
setSorting(-1); sortItems(-1, Qt::AscendingOrder);
setColumnText(0, i18n("Time")); headerItem()->setText(0, i18n("Time"));
} }
HistoryPlaylist::~HistoryPlaylist() HistoryPlaylist::~HistoryPlaylist()
...@@ -48,10 +48,10 @@ HistoryPlaylist::~HistoryPlaylist() ...@@ -48,10 +48,10 @@ HistoryPlaylist::~HistoryPlaylist()
} }
HistoryPlaylistItem *HistoryPlaylist::createItem(const FileHandle &file, HistoryPlaylistItem *HistoryPlaylist::createItem(const FileHandle &file,
Q3ListViewItem *after, bool emitChanged) QTreeWidgetItem *after, bool emitChanged)
{ {
if(!after) if(!after)
after = lastItem(); after = topLevelItem(topLevelItemCount() - 1);
return Playlist::createItem<HistoryPlaylistItem>(file, after, emitChanged); return Playlist::createItem<HistoryPlaylistItem>(file, after, emitChanged);
} }
...@@ -84,7 +84,7 @@ void HistoryPlaylist::slotCreateNewItem() ...@@ -84,7 +84,7 @@ void HistoryPlaylist::slotCreateNewItem()
// HistoryPlaylistItem public members // HistoryPlaylistItem public members
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
HistoryPlaylistItem::HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, Q3ListViewItem *after) : HistoryPlaylistItem::HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, QTreeWidgetItem *after) :
PlaylistItem(item, parent, after), PlaylistItem(item, parent, after),
m_dateTime(QDateTime::currentDateTime()) m_dateTime(QDateTime::currentDateTime())
{ {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
class HistoryPlaylistItem : public PlaylistItem class HistoryPlaylistItem : public PlaylistItem
{ {
public: public:
HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, Q3ListViewItem *after); HistoryPlaylistItem(CollectionListItem *item, Playlist *parent, QTreeWidgetItem *after);
HistoryPlaylistItem(CollectionListItem *item, Playlist *parent); HistoryPlaylistItem(CollectionListItem *item, Playlist *parent);
virtual ~HistoryPlaylistItem(); virtual ~HistoryPlaylistItem();
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
HistoryPlaylist(PlaylistCollection *collection); HistoryPlaylist(PlaylistCollection *collection);
virtual ~HistoryPlaylist(); virtual ~HistoryPlaylist();
virtual HistoryPlaylistItem *createItem(const FileHandle &file, Q3ListViewItem *after = 0, virtual HistoryPlaylistItem *createItem(const FileHandle &file, QTreeWidgetItem *after = 0,
bool emitChanged = true); bool emitChanged = true);
virtual void createItems(const PlaylistItemList &siblings); virtual void createItems(const PlaylistItemList &siblings);
virtual int columnOffset() const { return 1; } virtual int columnOffset() const { return 1; }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <kaction.h> #include <kaction.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kapplication.h> #include <kapplication.h>
#include <kglobal.h>
#include <kglobalaccel.h> #include <kglobalaccel.h>
#include <ktoolbarpopupaction.h> #include <ktoolbarpopupaction.h>
#include <knotification.h> #include <knotification.h>
...@@ -74,7 +75,7 @@ void deleteAndClear(T *&ptr) ...@@ -74,7 +75,7 @@ void deleteAndClear(T *&ptr)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
JuK::JuK(QWidget *parent) : JuK::JuK(QWidget *parent) :
KXmlGuiWindow(parent, Qt::WDestructiveClose), KXmlGuiWindow(parent, Qt::WindowFlags(Qt::WA_DeleteOnClose)),
m_splitter(0), m_splitter(0),
m_statusLabel(0), m_statusLabel(0),
m_systemTray(0), m_systemTray(0),
...@@ -91,7 +92,7 @@ JuK::JuK(QWidget *parent) : ...@@ -91,7 +92,7 @@ JuK::JuK(QWidget *parent) :
if(m_showSplash && !m_startDocked && Cache::cacheFileExists()) { if(m_showSplash && !m_startDocked && Cache::cacheFileExists()) {
if(SplashScreen* splash = SplashScreen::instance()) { if(SplashScreen* splash = SplashScreen::instance()) {
splash->show(); splash->show();
kapp->processEvents(); qApp->processEvents();
} }
} }
...@@ -201,7 +202,7 @@ void JuK::setupActions() ...@@ -201,7 +202,7 @@ void JuK::setupActions()
KStandardAction::cut(collection); KStandardAction::cut(collection);
KStandardAction::copy(collection); KStandardAction::copy(collection);
KStandardAction::paste(collection); KStandardAction::paste(collection);
KAction *clear = KStandardAction::clear(collection); QAction *clear = KStandardAction::clear(collection);
KStandardAction::selectAll(collection); KStandardAction::selectAll(collection);
KStandardAction::keyBindings(this, SLOT(slotEditKeys()), collection); KStandardAction::keyBindings(this, SLOT(slotEditKeys()), collection);
...@@ -377,13 +378,13 @@ void JuK::setupGlobalAccels() ...@@ -377,13 +378,13 @@ void JuK::setupGlobalAccels()
void JuK::slotProcessArgs() void JuK::slotProcessArgs()
{ {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); /*KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QStringList files; QStringList files;
for(int i = 0; i < args->count(); i++) for(int i = 0; i < args->count(); i++)
files.append(args->arg(i)); files.append(args->arg(i));*/
CollectionList::instance()->addFiles(files); //CollectionList::instance()->addFiles(files);
} }