Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updates to qt5.
  • Loading branch information
locusf committed Aug 12, 2013
1 parent 0aaab2e commit b010a65
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 66 deletions.
9 changes: 7 additions & 2 deletions mediabox-core/contentmodel.cpp
Expand Up @@ -43,11 +43,16 @@ content::ContentModel::ContentModel(content::ContentProvider *cp,

myContentProvider->registerSource("file", new content::LocalSource);

setRoleNames(roles);
connect(myContentProvider, SIGNAL(newFile(int,content::File::Ptr)),
this, SLOT(handleNewFile(int,content::File::Ptr)));
}

QHash<int, QByteArray> content::ContentModel::roleNames() const {
QHash<int, QByteArray> roles;
roles[Qt::DisplayRole] = "name";
return roles;
}

content::ContentModel::~ContentModel()
{
clearFiles();
Expand Down Expand Up @@ -140,7 +145,7 @@ void content::ContentModel::update()
{
beginResetModel();
clearFiles();
reset();
revert();
endResetModel();

myContentCookie = myContentProvider->cookie();
Expand Down
1 change: 1 addition & 0 deletions mediabox-core/contentmodel.h
Expand Up @@ -63,6 +63,7 @@ class ContentModel : public QAbstractListModel
Q_INVOKABLE QVariant getPath(int row);
Q_INVOKABLE void update();
int count();
QHash<int, QByteArray> roleNames() const;

QString path();
void setPath(QString path);
Expand Down
5 changes: 2 additions & 3 deletions mediabox-core/datadirectory.cpp
Expand Up @@ -19,16 +19,15 @@

#include "datadirectory.h"
#include <QDir>
#include <QDesktopServices>
#include <QStandardPaths>
#include <QDebug>

QString DataDirectory::Path;
QString DataDirectory::Covers;

void DataDirectory::initialize()
{
QDir dataDir(
QDesktopServices::storageLocation(QDesktopServices::DataLocation));
QDir dataDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
qDebug() << "Using data location:" << dataDir.path();
if (! dataDir.exists("mediaboxcore"))
{
Expand Down
3 changes: 1 addition & 2 deletions qml/AlbumView.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0
import "config.js" as Config

Item {
Expand Down Expand Up @@ -84,7 +84,6 @@ Item {
}

MouseArea {
anchors.fill: parent
onClicked: {
console.log("clicked track" + tracksModel.count);
var amount = index;
Expand Down
2 changes: 1 addition & 1 deletion qml/ComboBox.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0

Rectangle {
property alias model: list.model
Expand Down
2 changes: 1 addition & 1 deletion qml/Cover.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0
import "config.js" as Config

Item {
Expand Down
2 changes: 1 addition & 1 deletion qml/CoverFlow.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0
import "config.js" as Config

PathView {
Expand Down
2 changes: 1 addition & 1 deletion qml/ImageButton.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0

Image {
property string source1: ""
Expand Down
4 changes: 2 additions & 2 deletions qml/MainPage.qml
@@ -1,5 +1,5 @@
import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

Page {
Rectangle {
Expand Down
2 changes: 1 addition & 1 deletion qml/NowPlaying.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0

Rectangle {

Expand Down
2 changes: 1 addition & 1 deletion qml/PlayerControls.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0

Rectangle {
property bool portrait: width < 500
Expand Down
2 changes: 1 addition & 1 deletion qml/ProgressBar.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0

Item {
property double value: 0.0
Expand Down
2 changes: 1 addition & 1 deletion qml/ScreenRow.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0

Item {
property alias screen0: scr0.children
Expand Down
2 changes: 1 addition & 1 deletion qml/Scrollbar.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0

Rectangle {
property variant scrollTarget
Expand Down
2 changes: 1 addition & 1 deletion qml/SettingsAbout.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0
import "license.js" as License
import "config.js" as Config

Expand Down
4 changes: 2 additions & 2 deletions qml/SettingsIndexing.qml
Expand Up @@ -17,8 +17,8 @@
*/


import Qt 4.7
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

import "config.js" as Config

Expand Down
2 changes: 1 addition & 1 deletion qml/SettingsMenu.qml
Expand Up @@ -17,7 +17,7 @@
*/


import Qt 4.7
import QtQuick 2.0
import "config.js" as Config

Rectangle {
Expand Down
4 changes: 2 additions & 2 deletions qml/main.qml
Expand Up @@ -17,8 +17,8 @@
*/


import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

PageStackWindow {
id: appWindow
Expand Down
11 changes: 9 additions & 2 deletions qmlmediaplayer.pro
@@ -1,5 +1,5 @@

QT += core gui declarative sql dbus
QT += core gui qml quick sql dbus multimedia widgets

CONFIG += mobility
MOBILITY += multimedia
Expand All @@ -26,4 +26,11 @@ icon.path = /usr/share/pixmaps
icon.files = data/qmlmediaplayer.png

INSTALLS += target desktop icon

CONFIG += link_pkgconfig
packagesExist(qdeclarative5-boostable) {
message("Building with qdeclarative5-boostable support")
DEFINES += HAS_BOOSTER
PKGCONFIG += qdeclarative5-boostable
} else {
warning("qdeclarative5-boostable not available; startup times will be slower")
}
14 changes: 7 additions & 7 deletions rpm/qmlmusicplayer.spec
@@ -1,6 +1,6 @@
#
# Do NOT Edit the Auto-generated Part!
# Generated by: spectacle version 0.25
# Generated by: spectacle version 0.27
#

Name: qmlmusicplayer
Expand All @@ -15,17 +15,17 @@ Group: Applications/Multimedia
License: GPLv2
Source0: %{name}-%{version}.tar.bz2
Source100: qmlmusicplayer.yaml
BuildRequires: pkgconfig(QtDeclarative)
BuildRequires: pkgconfig(QtMultimediaKit)
BuildRequires: pkgconfig(QtOpenGL)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Multimedia)
BuildRequires: pkgconfig(Qt5OpenGL)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: desktop-file-utils
Provides: org.pycage.musicshelf > 1.0.1
Obsoletes: org.pycage.musicshelf <= 1.0.1

%description
Music Player for Nemo Mobile


%prep
%setup -q -n %{name}-%{version}

Expand All @@ -36,7 +36,7 @@ Music Player for Nemo Mobile
# >> build pre
# << build pre

%qmake
%qmake5

make %{?jobs:-j%jobs}

Expand All @@ -47,7 +47,7 @@ make %{?jobs:-j%jobs}
rm -rf %{buildroot}
# >> install pre
# << install pre
%qmake_install
%qmake5_install

# >> install post
# << install post
Expand Down
9 changes: 5 additions & 4 deletions rpm/qmlmusicplayer.yaml
Expand Up @@ -12,8 +12,9 @@ Provides:
Obsoletes:
- org.pycage.musicshelf <= 1.0.1
PkgConfigBR:
- QtDeclarative
- QtMultimediaKit
- QtOpenGL
- Qt5Quick
- Qt5Multimedia
- Qt5OpenGL
- Qt5DBus
Configure: none
Builder: qmake
Builder: qmake5
9 changes: 5 additions & 4 deletions src/foldermodel.cpp
Expand Up @@ -35,12 +35,13 @@ FolderModel::FolderModel(QObject *parent) :
myFolders << finfo.fileName();
}
}

QHash<int, QByteArray> roles;
roles[Qt::DisplayRole] = "name";
setRoleNames(roles);
}

QHash<int, QByteArray> FolderModel::roleNames() const {
QHash<int, QByteArray> roles;
roles[Qt::DisplayRole] = "name";
return roles;
}
int FolderModel::rowCount(const QModelIndex&) const
{
return myFolders.size();
Expand Down
2 changes: 1 addition & 1 deletion src/foldermodel.h
Expand Up @@ -32,7 +32,7 @@ class FolderModel : public QAbstractListModel

virtual int rowCount(const QModelIndex &parent) const;
virtual QVariant data(const QModelIndex &index, int role) const;

QHash<int, QByteArray> roleNames() const;
Q_INVOKABLE QVariant get(int index)
{
return QVariant(myFolders.at(index));
Expand Down

0 comments on commit b010a65

Please sign in to comment.