More code re-org

This commit is contained in:
craig
2011-12-03 20:17:23 +00:00
committed by craig
parent 4299c667f5
commit 7bde289b76
50 changed files with 71 additions and 364 deletions

View File

@@ -20,24 +20,7 @@ include(CPack)
SET( CANTATA_SRCS
main.cpp
gui/mainwindow.cpp
gui/musiclibraryitem.cpp
gui/musiclibraryitemroot.cpp
gui/musiclibraryitemartist.cpp
gui/musiclibraryitemalbum.cpp
gui/musiclibraryitemsong.cpp
gui/musiclibrarymodel.cpp
gui/musiclibraryproxymodel.cpp
gui/playlistsmodel.cpp
gui/playlistsproxymodel.cpp
gui/playlisttablemodel.cpp
gui/playlisttableproxymodel.cpp
gui/preferencesdialog.cpp
gui/dirviewmodel.cpp
gui/dirviewproxymodel.cpp
gui/dirviewitem.cpp
gui/dirviewitemfile.cpp
gui/dirviewitemdir.cpp
gui/dirviewitemroot.cpp
gui/settings.cpp
gui/updatedialog.cpp
gui/covers.cpp
@@ -45,6 +28,23 @@ SET( CANTATA_SRCS
gui/playbacksettings.cpp
gui/serversettings.cpp
gui/outputsettings.cpp
models/musiclibraryitem.cpp
models/musiclibraryitemroot.cpp
models/musiclibraryitemartist.cpp
models/musiclibraryitemalbum.cpp
models/musiclibraryitemsong.cpp
models/musiclibrarymodel.cpp
models/musiclibraryproxymodel.cpp
models/playlistsmodel.cpp
models/playlistsproxymodel.cpp
models/playlisttablemodel.cpp
models/playlisttableproxymodel.cpp
models/dirviewmodel.cpp
models/dirviewproxymodel.cpp
models/dirviewitem.cpp
models/dirviewitemfile.cpp
models/dirviewitemdir.cpp
models/dirviewitemroot.cpp
mpd/mpdconnection.cpp
mpd/mpdparseutils.cpp
mpd/mpdstats.cpp
@@ -62,15 +62,6 @@ SET( CANTATA_SRCS
SET( CANTATA_MOC_HDRS
gui/mainwindow.h
gui/musiclibrarymodel.h
gui/musiclibraryproxymodel.h
gui/playlistsmodel.h
gui/playlistsproxymodel.h
gui/playlisttablemodel.h
gui/playlisttableproxymodel.h
gui/preferencesdialog.h
gui/dirviewmodel.h
gui/dirviewproxymodel.h
gui/updatedialog.h
gui/covers.h
gui/folderpage.h
@@ -80,6 +71,15 @@ SET( CANTATA_MOC_HDRS
gui/playbacksettings.h
gui/serversettings.h
gui/outputsettings.h
gui/preferencesdialog.h
models/musiclibrarymodel.h
models/musiclibraryproxymodel.h
models/playlistsmodel.h
models/playlistsproxymodel.h
models/playlisttablemodel.h
models/playlisttableproxymodel.h
models/dirviewmodel.h
models/dirviewproxymodel.h
mpd/mpdconnection.h
mpd/output.h
mpd/playlist.h
@@ -111,7 +111,8 @@ SET( CANTATA_RCS cantata.qrc )
include_directories( ${CMAKE_SOURCE_DIR}/external/libmaia
${CMAKE_SOURCE_DIR}/gui
${CMAKE_SOURCE_DIR}/lib
${CMAKE_SOURCE_DIR}/mpd
${CMAKE_SOURCE_DIR}/models
${CMAKE_SOURCE_DIR}/widgets
${CMAKE_SOURCE_DIR}/lyrics
${CMAKE_SOURCE_DIR}/network

View File

@@ -1,28 +0,0 @@
/*
* Copyright (c) 2008 Sander Knopper (sander AT knopper DOT tk) and
* Roeland Douma (roeland AT rullzer DOT com)
*
* This file is part of QtMPC.
*
* QtMPC is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* QtMPC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with QtMPC. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "aboutdialog.h"
AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
{
setupUi(this);
titleLabel->setText(PACKAGE_STRING);
}

View File

@@ -1,36 +0,0 @@
/*
* Copyright (c) 2008 Sander Knopper (sander AT knopper DOT tk) and
* Roeland Douma (roeland AT rullzer DOT com)
*
* This file is part of QtMPC.
*
* QtMPC is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* QtMPC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with QtMPC. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ABOUT_DIALOG_H
#define ABOUT_DIALOG_H
#include <QDialog>
#include "ui_aboutdialog.h"
class AboutDialog : public QDialog, private Ui::AboutDialog
{
Q_OBJECT
public:
AboutDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
};
#endif

View File

@@ -1,208 +0,0 @@
<ui version="4.0" >
<author>Sander Knopper</author>
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>510</width>
<height>540</height>
</rect>
</property>
<property name="windowTitle" >
<string>About Cantata</string>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<property name="bottomMargin" >
<number>18</number>
</property>
<item>
<widget class="QLabel" name="label_5" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
<property name="pixmap" >
<pixmap resource="../cantata.qrc" >:/icons/icon.svg</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="titleLabel" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font" >
<font>
<pointsize>16</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
<number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>About</string>
</attribute>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Authors:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Sander Knopper</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Roeland Douma</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>Website:</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>&lt;a href="http://qtmpc.lowblog.nl/">http://qtmpc.lowblog.nl&lt;/a></string>
</property>
<property name="openExternalLinks" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>131</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
<string>License</string>
</attribute>
<layout class="QHBoxLayout" >
<item>
<widget class="QTextBrowser" name="textBrowser" >
<property name="html" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Serif'; font-size:10pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">Cantata, a Qt4-based graphical user interface to control MPD.&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">Copyright (C) 2007-2008 Sander Knopper, Roeland Douma&lt;/p>
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">This program is free software; you can redistribute it and/or modify&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">it under the terms of the GNU General Public License as published by&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">the Free Software Foundation; either version 2 of the License, or&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">(at your option) any later version.&lt;/p>
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">This program is distributed in the hope that it will be useful,&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">GNU General Public License for more details.&lt;/p>
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">You should have received a copy of the GNU General Public License along&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">with this program; if not, write to the Free Software Foundation, Inc.,&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="standardButtons" >
<set>QDialogButtonBox::Close</set>
</property>
<property name="centerButtons" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../cantata.qrc" />
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -1,7 +1,7 @@
#include "covers.h"
#include "musiclibrarymodel.h"
#include "lib/song.h"
#include "lib/mpdparseutils.h"
#include "song.h"
#include "mpdparseutils.h"
#include "maiaXmlRpcClient.h"
#include "networkaccessmanager.h"
#include <QtCore/QFile>

View File

@@ -49,10 +49,10 @@
#include "mainwindow.h"
#include "musiclibraryitemsong.h"
#include "preferencesdialog.h"
#include "lib/mpdconnection.h"
#include "lib/mpdstats.h"
#include "lib/mpdstatus.h"
#include "lib/mpdparseutils.h"
#include "mpdconnection.h"
#include "mpdstats.h"
#include "mpdstatus.h"
#include "mpdparseutils.h"
#include "settings.h"
#include "updatedialog.h"
#include "config.h"

View File

@@ -40,16 +40,16 @@
#include <QMoveEvent>
#include "ui_mainwindow.h"
#include "gui/musiclibrarymodel.h"
#include "gui/musiclibraryproxymodel.h"
#include "gui/playlistsmodel.h"
#include "gui/playlistsproxymodel.h"
#include "gui/playlisttablemodel.h"
#include "gui/playlisttableproxymodel.h"
#include "gui/dirviewmodel.h"
#include "gui/dirviewproxymodel.h"
#include "lib/mpdstatus.h"
#include "lib/song.h"
#include "musiclibrarymodel.h"
#include "musiclibraryproxymodel.h"
#include "playlistsmodel.h"
#include "playlistsproxymodel.h"
#include "playlisttablemodel.h"
#include "playlisttableproxymodel.h"
#include "dirviewmodel.h"
#include "dirviewproxymodel.h"
#include "mpdstatus.h"
#include "song.h"
#ifdef ENABLE_KDE_SUPPORT
class KAction;

View File

@@ -1,5 +1,5 @@
#include "outputsettings.h"
#include "lib/mpdconnection.h"
#include "mpdconnection.h"
#include <QtGui/QListWidget>
OutputSettings::OutputSettings(QWidget *p)

View File

@@ -2,7 +2,7 @@
#define OUTPUTSETTINGS_H
#include "ui_outputsettings.h"
#include "lib/output.h"
#include "output.h"
#include <QtCore/QList>
class OutputSettings : public QWidget, private Ui::OutputSettings

View File

@@ -1,5 +1,5 @@
#include "playbacksettings.h"
#include "lib/mpdconnection.h"
#include "mpdconnection.h"
#ifdef ENABLE_KDE_SUPPORT
#include <KDE/KLocale>
#endif

View File

@@ -20,7 +20,7 @@
#include "networkaccessmanager.h"
//#include "core/network.h"
#include "lib/song.h"
#include "song.h"
#include <QNetworkReply>
#include <QTextCodec>

View File

@@ -24,7 +24,6 @@
#include <QString>
#include <QList>
#include <QVariant>
#include "dirviewitem.h"
class DirViewItemDir : public DirViewItem

View File

@@ -23,7 +23,6 @@
#include <QString>
#include <QList>
#include <QVariant>
#include "dirviewitem.h"
class DirViewItemFile : public DirViewItem

View File

@@ -24,7 +24,6 @@
#include <QString>
#include <QList>
#include <QVariant>
#include "dirviewitem.h"
class DirViewItemRoot : public DirViewItem

View File

@@ -23,7 +23,6 @@
#include <QAbstractItemModel>
#include <QList>
#include <QModelIndex>
#include "dirviewitemroot.h"
class dirViewModel : public QAbstractItemModel

View File

@@ -20,7 +20,6 @@
#include "musiclibraryitem.h"
MusicLibraryItem::MusicLibraryItem(const QString &data, Type type)
: m_type(type),
m_itemData(data)

View File

@@ -21,7 +21,7 @@
#include "musiclibraryitemartist.h"
#include "musiclibraryitemalbum.h"
#include "musiclibraryitemsong.h"
#include "lib/song.h"
#include "song.h"
#include "covers.h"
#include <QtGui/QIcon>
#include <QtGui/QPixmap>

View File

@@ -23,10 +23,8 @@
#include <QList>
#include <QVariant>
#include "musiclibraryitem.h"
class MusicLibraryItemRoot;
class MusicLibraryItemAlbum;

View File

@@ -21,7 +21,6 @@
#include "musiclibraryitemroot.h"
#include "musiclibraryitemartist.h"
MusicLibraryItemRoot::MusicLibraryItemRoot(const QString &data)
: MusicLibraryItem(data, MusicLibraryItem::Type_Root)
{

View File

@@ -23,7 +23,6 @@
#include <QList>
#include <QVariant>
#include "musiclibraryitem.h"
class MusicLibraryItemArtist;

View File

@@ -21,7 +21,6 @@
#include "musiclibraryitemalbum.h"
#include "musiclibraryitemsong.h"
MusicLibraryItemSong::MusicLibraryItemSong(const QString &data, MusicLibraryItem *parent)
: MusicLibraryItem(data, MusicLibraryItem::Type_Song),
m_track(0),

View File

@@ -23,7 +23,6 @@
#include <QList>
#include <QVariant>
#include "musiclibraryitem.h"
class MusicLibraryItemAlbum;

View File

@@ -18,10 +18,10 @@
* along with QtMPC. If not, see <http://www.gnu.org/licenses/>.
*/
#include "gui/musiclibraryitemalbum.h"
#include "gui/musiclibraryitemartist.h"
#include "gui/musiclibraryitemsong.h"
#include "gui/musiclibraryitemroot.h"
#include "musiclibraryitemalbum.h"
#include "musiclibraryitemartist.h"
#include "musiclibraryitemsong.h"
#include "musiclibraryitemroot.h"
#include "musiclibrarymodel.h"
#include "settings.h"
#include "config.h"

View File

@@ -25,9 +25,8 @@
#include <QDateTime>
#include <QMimeData>
#include <QMutex>
#include "gui/musiclibraryitemroot.h"
#include "lib/song.h"
#include "musiclibraryitemroot.h"
#include "song.h"
class MusicLibraryItemAlbum;
class MusicLibraryItemArtist;

View File

@@ -19,11 +19,10 @@
*/
#include <QModelIndex>
#include "playlistsmodel.h"
#include "lib/mpdparseutils.h"
#include "lib/mpdstats.h"
#include "lib/mpdconnection.h"
#include "mpdparseutils.h"
#include "mpdstats.h"
#include "mpdconnection.h"
PlaylistsModel::PlaylistsModel(QObject *parent)
: QAbstractListModel(parent)

View File

@@ -23,7 +23,7 @@
#include <QAbstractListModel>
#include <QList>
#include "lib/playlist.h"
#include "playlist.h"
class PlaylistsModel : public QAbstractListModel
{

View File

@@ -27,9 +27,9 @@
#include <KDE/KLocale>
#endif
#include "playlisttablemodel.h"
#include "lib/mpdparseutils.h"
#include "lib/mpdstats.h"
#include "lib/mpdstatus.h"
#include "mpdparseutils.h"
#include "mpdstats.h"
#include "mpdstatus.h"
PlaylistTableModel::PlaylistTableModel(QObject *parent)
: QAbstractTableModel(parent),

View File

@@ -25,8 +25,7 @@
#include <QList>
#include <QStringList>
#include <QSet>
#include "lib/song.h"
#include "song.h"
class PlaylistTableModel : public QAbstractTableModel
{

View File

@@ -19,7 +19,6 @@
*/
#include <QByteArray>
#include "playlisttableproxymodel.h"
#include "playlisttablemodel.h"
@@ -64,4 +63,4 @@ bool PlaylistTableProxyModel::dropMimeData(const QMimeData *data,
const QModelIndex sourceIndex = mapToSource(index);
return sourceModel()->dropMimeData(data, action, sourceIndex.row(), sourceIndex.column(), sourceIndex.parent());
}
}

View File

@@ -25,7 +25,6 @@
#include <QThread>
#include <QTcpSocket>
#include <QDateTime>
#include "mpdstats.h"
#include "mpdstatus.h"
#include "song.h"

View File

@@ -22,12 +22,13 @@
#include <QString>
#include <QStringList>
#include "gui/dirviewitemroot.h"
#include "gui/dirviewitemdir.h"
#include "gui/dirviewitemfile.h"
#include "gui/musiclibraryitemartist.h"
#include "gui/musiclibraryitemalbum.h"
#include "gui/musiclibraryitemsong.h"
#include "dirviewitemroot.h"
#include "dirviewitemdir.h"
#include "dirviewitemfile.h"
#include "musiclibraryitemartist.h"
#include "musiclibraryitemalbum.h"
#include "musiclibraryitemsong.h"
#include "musiclibraryitemroot.h"
#include "mpdparseutils.h"
#include "mpdstats.h"
#include "mpdstatus.h"
@@ -35,7 +36,6 @@
#include "song.h"
#include "output.h"
#include "covers.h"
#include "gui/musiclibraryitemroot.h"
#ifdef ENABLE_KDE_SUPPORT
#include <KDE/KLocale>
#endif

View File

@@ -20,9 +20,6 @@
#include "mpdstats.h"
MPDStats * MPDStats::self()
{
static MPDStats instance;

View File

@@ -24,7 +24,6 @@
#include <QtCore>
#include <QtGlobal>
class MPDStatus
{
public:

View File

@@ -1,9 +1,7 @@
#include "networkproxyfactory.h"
#include <QMutexLocker>
#include <QSettings>
#include <QStringList>
#include <stdlib.h>
NetworkProxyFactory* NetworkProxyFactory::sInstance = NULL;