Re-organise the code a little...
This commit is contained in:
committed by
craig.p.drummond
parent
c60604502f
commit
b30c62470b
@@ -72,8 +72,8 @@ macro(cantata_check_for_sse)
|
||||
endmacro(cantata_check_for_sse)
|
||||
|
||||
SET( CANTATA_SRCS
|
||||
application.cpp
|
||||
main.cpp
|
||||
gui/application.cpp
|
||||
gui/main.cpp
|
||||
gui/initialsettingswizard.cpp
|
||||
gui/mainwindow.cpp
|
||||
gui/preferencesdialog.cpp
|
||||
@@ -83,9 +83,6 @@ SET( CANTATA_SRCS
|
||||
gui/playbacksettings.cpp
|
||||
gui/serverplaybacksettings.cpp
|
||||
gui/serversettings.cpp
|
||||
gui/streamspage.cpp
|
||||
gui/streamdialog.cpp
|
||||
gui/streamcategorydialog.cpp
|
||||
gui/librarypage.cpp
|
||||
gui/albumspage.cpp
|
||||
gui/folderpage.cpp
|
||||
@@ -93,6 +90,10 @@ SET( CANTATA_SRCS
|
||||
gui/trayitem.cpp
|
||||
gui/cachesettings.cpp
|
||||
gui/coverdialog.cpp
|
||||
streams/streamspage.cpp
|
||||
streams/streamdialog.cpp
|
||||
streams/streamcategorydialog.cpp
|
||||
streams/streamfetcher.cpp
|
||||
models/musiclibraryitemroot.cpp
|
||||
models/musiclibraryitemartist.cpp
|
||||
models/musiclibraryitemalbum.cpp
|
||||
@@ -110,7 +111,6 @@ SET( CANTATA_SRCS
|
||||
models/streamsproxymodel.cpp
|
||||
models/albumsmodel.cpp
|
||||
models/albumsproxymodel.cpp
|
||||
models/streamfetcher.cpp
|
||||
models/proxymodel.cpp
|
||||
models/onlineservicesmodel.cpp
|
||||
mpd/mpdconnection.cpp
|
||||
@@ -162,9 +162,6 @@ SET( CANTATA_MOC_HDRS
|
||||
gui/librarypage.h
|
||||
gui/albumspage.h
|
||||
gui/playlistspage.h
|
||||
gui/streamspage.h
|
||||
gui/streamdialog.h
|
||||
gui/streamcategorydialog.h
|
||||
gui/serverplaybacksettings.h
|
||||
gui/serversettings.h
|
||||
gui/preferencesdialog.h
|
||||
@@ -172,6 +169,10 @@ SET( CANTATA_MOC_HDRS
|
||||
gui/cachesettings.h
|
||||
gui/trayitem.h
|
||||
gui/coverdialog.h
|
||||
streams/streamspage.h
|
||||
streams/streamdialog.h
|
||||
streams/streamcategorydialog.h
|
||||
streams/streamfetcher.h
|
||||
models/musiclibrarymodel.h
|
||||
models/musiclibraryproxymodel.h
|
||||
models/playlistsmodel.h
|
||||
@@ -181,7 +182,6 @@ SET( CANTATA_MOC_HDRS
|
||||
models/dirviewmodel.h
|
||||
models/dirviewproxymodel.h
|
||||
models/albumsmodel.h
|
||||
models/streamfetcher.h
|
||||
models/streamsmodel.h
|
||||
models/onlineservicesmodel.h
|
||||
mpd/mpdconnection.h
|
||||
@@ -224,12 +224,12 @@ SET( CANTATA_UIS
|
||||
gui/librarypage.ui
|
||||
gui/albumspage.ui
|
||||
gui/playlistspage.ui
|
||||
gui/streamspage.ui
|
||||
gui/interfacesettings.ui
|
||||
gui/playbacksettings.ui
|
||||
gui/serverplaybacksettings.ui
|
||||
gui/serversettings.ui
|
||||
gui/coverdialog.ui
|
||||
streams/streamspage.ui
|
||||
dynamic/dynamicpage.ui
|
||||
dynamic/dynamicrule.ui
|
||||
dynamic/dynamicrules.ui
|
||||
@@ -247,27 +247,27 @@ endif (ENABLE_TAGLIB)
|
||||
if (TAGLIB_FOUND)
|
||||
SET( CANTATA_SRCS ${CANTATA_SRCS}
|
||||
gui/httpserversettings.cpp
|
||||
gui/tageditor.cpp
|
||||
tags/tageditor.cpp
|
||||
tags/trackorganiser.cpp
|
||||
tags/tags.cpp
|
||||
devices/deviceoptions.cpp
|
||||
devices/trackorganiser.cpp
|
||||
devices/filenameschemedialog.cpp
|
||||
http/httpserver.cpp
|
||||
http/httpsocket.cpp
|
||||
devices/filenameschemedialog.cpp
|
||||
devices/tags.cpp
|
||||
)
|
||||
|
||||
SET( CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS}
|
||||
gui/tageditor.h
|
||||
tags/tageditor.h
|
||||
tags/trackorganiser.h
|
||||
http/httpsocket.h
|
||||
devices/filenameschemedialog.h
|
||||
devices/trackorganiser.h
|
||||
)
|
||||
|
||||
SET( CANTATA_UIS ${CANTATA_UIS}
|
||||
gui/httpserversettings.ui
|
||||
gui/tageditor.ui
|
||||
tags/tageditor.ui
|
||||
tags/trackorganiser.ui
|
||||
devices/filenameschemedialog.ui
|
||||
devices/trackorganiser.ui
|
||||
)
|
||||
endif (TAGLIB_FOUND)
|
||||
|
||||
@@ -299,6 +299,8 @@ include_directories( ${CMAKE_SOURCE_DIR}/gui
|
||||
${CMAKE_SOURCE_DIR}/devices
|
||||
${CMAKE_SOURCE_DIR}/dynamic
|
||||
${CMAKE_SOURCE_DIR}/support
|
||||
${CMAKE_SOURCE_DIR}/streams
|
||||
${CMAKE_SOURCE_DIR}/tags
|
||||
${CMAKE_BINARY_DIR}/support
|
||||
${CMAKE_SOURCE_DIR}/online
|
||||
${CMAKE_SOURCE_DIR}
|
||||
@@ -395,7 +397,7 @@ if (TAGLIB_FOUND)
|
||||
endif(FFMPEG_FOUND OR MPG123_FOUND)
|
||||
|
||||
if (WIN32)
|
||||
SET( CANTATA_SRCS ${CANTATA_SRCS} devices/device.cpp devices/filetyperesolver.cpp)
|
||||
SET( CANTATA_SRCS ${CANTATA_SRCS} devices/device.cpp tags/filetyperesolver.cpp)
|
||||
else (WIN32)
|
||||
set (ENABLE_DEVICES_SUPPORT 1)
|
||||
if (NOT ENABLE_KDE_SUPPORT)
|
||||
@@ -411,7 +413,7 @@ if (TAGLIB_FOUND)
|
||||
|
||||
SET( CANTATA_SRCS ${CANTATA_SRCS} devices/devicespage.cpp devices/filejob.cpp
|
||||
devices/device.cpp devices/fsdevice.cpp devices/umsdevice.cpp
|
||||
models/devicesmodel.cpp devices/filetyperesolver.cpp devices/actiondialog.cpp devices/devicepropertieswidget.cpp
|
||||
models/devicesmodel.cpp tags/filetyperesolver.cpp devices/actiondialog.cpp devices/devicepropertieswidget.cpp
|
||||
devices/devicepropertiesdialog.cpp devices/encoders.cpp devices/freespaceinfo.cpp
|
||||
devices/transcodingjob.cpp devices/valueslider.cpp devices/syncdialog.cpp devices/synccollectionwidget.cpp)
|
||||
SET( CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} devices/devicespage.h devices/filejob.h
|
||||
@@ -453,7 +455,7 @@ IF( ENABLE_KDE_SUPPORT )
|
||||
install( FILES cantata.notifyrc DESTINATION ${DATA_INSTALL_DIR}/cantata )
|
||||
ELSE( ENABLE_KDE_SUPPORT )
|
||||
if (WIN32)
|
||||
SET( CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} application.h )
|
||||
SET( CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} gui/application.h )
|
||||
IF( MINGW )
|
||||
# resource compilation for MinGW
|
||||
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cantataico.o
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="DirRequester" name="musicFolder"/>
|
||||
<widget class="PathRequester" name="musicFolder"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="BuddyLabel" name="albumCoversLabel">
|
||||
@@ -293,9 +293,9 @@
|
||||
<header>lineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>DirRequester</class>
|
||||
<class>PathRequester</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>dirrequester.h</header>
|
||||
<header>pathrequester.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="DirRequester" name="fileFolder"/>
|
||||
<widget class="PathRequester" name="fileFolder"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -310,9 +310,9 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>DirRequester</class>
|
||||
<class>PathRequester</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>dirrequester.h</header>
|
||||
<header>pathrequester.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>LineEdit</class>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="DirRequester" name="dir"/>
|
||||
<widget class="PathRequester" name="dir"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
@@ -411,9 +411,9 @@
|
||||
<header>lineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>DirRequester</class>
|
||||
<class>PathRequester</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>dirrequester.h</header>
|
||||
<header>pathrequester.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="DirRequester" name="dir"/>
|
||||
<widget class="PathRequester" name="dir"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="BuddyLabel" name="dynamizerPortLabel">
|
||||
@@ -282,9 +282,9 @@
|
||||
<header>lineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>DirRequester</class>
|
||||
<class>PathRequester</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>dirrequester.h</header>
|
||||
<header>pathrequester.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
||||
@@ -36,7 +36,7 @@ xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki1
|
||||
--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}_kde.pot || { echo "error while calling xgettext. aborting."; exit 1; }
|
||||
|
||||
find .. -name '*.cpp' | xargs grep -l 'QObject::tr(' | grep -v "solid-lite" | sort > ${WDIR}/infiles.qt.list
|
||||
echo "../qtplural.h" >> ${WDIR}/infiles.qt.list
|
||||
echo "../gui/qtplural.h" >> ${WDIR}/infiles.qt.list
|
||||
|
||||
# If we just call lconvert this adds a msgctxt of "QObject|<any other context>" This seems to mess things up.
|
||||
# So, pipe the output of lconvert into sed to change "QObject|<any other context>" to "<any other context>", and then into
|
||||
|
||||
@@ -29,10 +29,10 @@ if (ENABLE_KDE_SUPPORT )
|
||||
endif (NOT KDE_VERSION_47)
|
||||
KDE4_ADD_UI_FILES( SUPPORT_UI_HDRS ${SUPPORT_UIS} )
|
||||
else (ENABLE_KDE_SUPPORT)
|
||||
SET( SUPPORT_SRCS ${SUPPORT_SRCS} dirrequester.cpp lineedit.cpp kmessagewidget.cpp
|
||||
SET( SUPPORT_SRCS ${SUPPORT_SRCS} pathrequester.cpp lineedit.cpp kmessagewidget.cpp
|
||||
dialog.cpp messagebox.cpp pagewidget.cpp shortcutsmodel.cpp shortcutssettingspage.cpp
|
||||
keysequencewidget.cpp )
|
||||
SET( SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} dirrequester.h lineedit.h kmessagewidget.h urllabel.h
|
||||
SET( SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} pathrequester.h lineedit.h kmessagewidget.h urllabel.h
|
||||
dialog.h shortcutsmodel.h shortcutssettingspage.h keysequencewidget.h spinner.h )
|
||||
SET( SUPPORT_UIS shortcutssettingspage.ui )
|
||||
QT4_WRAP_UI( SUPPORT_UI_HDRS ${SUPPORT_UIS} )
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QComboBox>
|
||||
#include "spinbox.h"
|
||||
#ifndef ENABLE_KDE_SUPPORT
|
||||
#include "dirrequester.h"
|
||||
#include "pathrequester.h"
|
||||
#endif
|
||||
|
||||
class BuddyLabel : public QLabel
|
||||
@@ -56,9 +56,9 @@ protected:
|
||||
void mouseReleaseEvent(QMouseEvent *) {
|
||||
if (buddy() && buddy()->isEnabled()) {
|
||||
#ifndef ENABLE_KDE_SUPPORT
|
||||
DirRequester *d=qobject_cast<DirRequester*>(buddy());
|
||||
if (d) {
|
||||
d->setFocus();
|
||||
PathRequester *pr=qobject_cast<PathRequester*>(buddy());
|
||||
if (pr) {
|
||||
pr->setFocus();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "dirrequester.h"
|
||||
#include "pathrequester.h"
|
||||
#include "icon.h"
|
||||
#include "localize.h"
|
||||
#include "utils.h"
|
||||
#include <QFileDialog>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
DirRequester::DirRequester(QWidget *parent)
|
||||
PathRequester::PathRequester(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
QHBoxLayout *layout=new QHBoxLayout(this);
|
||||
@@ -43,7 +43,7 @@ DirRequester::DirRequester(QWidget *parent)
|
||||
connect(edit, SIGNAL(textChanged(const QString &)), SIGNAL(textChanged(const QString &)));
|
||||
}
|
||||
|
||||
void DirRequester::choose()
|
||||
void PathRequester::choose()
|
||||
{
|
||||
QString item=dirMode
|
||||
? QFileDialog::getExistingDirectory(this, i18n("Select Folder"), edit->text())
|
||||
@@ -53,7 +53,7 @@ void DirRequester::choose()
|
||||
}
|
||||
}
|
||||
|
||||
void DirRequester::setEnabled(bool e)
|
||||
void PathRequester::setEnabled(bool e)
|
||||
{
|
||||
edit->setEnabled(e);
|
||||
btn->setEnabled(e);
|
||||
@@ -21,17 +21,17 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef DIR_REQUESER_H
|
||||
#define DIR_REQUESER_H
|
||||
#ifndef PATH_REQUESER_H
|
||||
#define PATH_REQUESER_H
|
||||
|
||||
#ifdef ENABLE_KDE_SUPPORT
|
||||
#include <KDE/KUrlRequester>
|
||||
#include <KDE/KLineEdit>
|
||||
#include <KDE/KPushButton>
|
||||
class DirRequester : public KUrlRequester
|
||||
class PathRequester : public KUrlRequester
|
||||
{
|
||||
public:
|
||||
DirRequester(QWidget *parent) : KUrlRequester(parent) {
|
||||
PathRequester(QWidget *parent) : KUrlRequester(parent) {
|
||||
setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly);
|
||||
}
|
||||
|
||||
@@ -42,12 +42,12 @@ public:
|
||||
#else
|
||||
#include "lineedit.h"
|
||||
#include <QToolButton>
|
||||
class DirRequester : public QWidget
|
||||
class PathRequester : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DirRequester(QWidget *parent);
|
||||
virtual ~DirRequester() { }
|
||||
PathRequester(QWidget *parent);
|
||||
virtual ~PathRequester() { }
|
||||
|
||||
QString text() const { return edit->text(); }
|
||||
void setText(const QString &t) { edit->setText(t); }
|
||||
Reference in New Issue
Block a user