Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Packaking] Move to libglacierapp
  • Loading branch information
neochapay committed Dec 27, 2017
1 parent 740657a commit 83ad3f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
4 changes: 2 additions & 2 deletions glacier-music.pro
Expand Up @@ -3,7 +3,7 @@ TARGET = glacier-music

QT += qml quick sql multimedia

LIBS += -ltag
LIBS += -ltag -lglacierapp

SOURCES += main.cpp \
src/collection.cpp \
Expand Down Expand Up @@ -62,4 +62,4 @@ HEADERS += \
src/downloader.h

CONFIG += link_pkgconfig
PKGCONFIG += taglib
PKGCONFIG += taglib glacierapp
25 changes: 7 additions & 18 deletions main.cpp
Expand Up @@ -28,6 +28,8 @@
#include <QScreen>
#include <QCoreApplication>

#include <glacierapp.h>

#include "src/collection.h"
#include "src/cover.h"
#include "src/models/artistsqlmodel.h"
Expand All @@ -38,9 +40,8 @@ int main(int argc, char *argv[])
{
setenv("QT_QUICK_CONTROLS_STYLE", "Nemo", 1);

QGuiApplication app(argc, argv);
app.setOrganizationName("NemoMobile");
app.setApplicationName("glacier-music");
QGuiApplication *app = GlacierApp::app(argc, argv);
app->setOrganizationName("NemoMobile");

qmlRegisterType<Collection>("org.glacier.music.collection",1,0,"Collection");
qmlRegisterType<Cover>("org.glacier.music.cover",1,0,"Cover");
Expand All @@ -49,21 +50,9 @@ int main(int argc, char *argv[])
qmlRegisterType<TrackSqlModel>("org.glacier.music.trackmodel",1,0,"TrackModel");
qmlRegisterType<PlayListModel>("org.glacier.music.playlistmodel",1,0,"PlaylistModel");

QQmlApplicationEngine* engine = new QQmlApplicationEngine(QUrl("/usr/share/glacier-music/qml/glacier-music.qml"));
QObject *topLevel = engine->rootObjects().value(0);
QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);

engine->rootContext()->setContextProperty("__window", window);

QQuickWindow *window = GlacierApp::showWindow();
window->setTitle(QObject::tr("Music"));
if (QCoreApplication::arguments().contains("--window")) {
window->show();
window->setIcon(QIcon("/usr/share/glacier-music/images/icon-app-music.png"));
}
else
{
window->showFullScreen();
}
window->setIcon(QIcon("/usr/share/glacier-music/images/icon-app-music.png"));

return app.exec();
return app->exec();
}
4 changes: 3 additions & 1 deletion rpm/glacier-music.spec
Expand Up @@ -7,20 +7,22 @@ Name: glacier-music
Summary: Glacier music player
Version: 0.1
Release: 1
Group: Qt/Qt
Group: Application/Media
License: LGPL
URL: https://github.com/nemomobile-ux/glacier-music
Source0: %{name}-%{version}.tar.bz2
Requires: qt5-qtquickcontrols-nemo
Requires: taglib >= 1.11.1
Requires: nemo-qml-plugin-settings
Requires: mpris-qt5-qml-plugin
Requires: libglacierapp

BuildRequires: pkgconfig(taglib) >= 1.11.1
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Multimedia)
BuildRequires: pkgconfig(glacierapp)
BuildRequires: desktop-file-utils

%description
Expand Down

0 comments on commit 83ad3f4

Please sign in to comment.