This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
amarokFS/amarokFS-0.5-start_amarok.patch
Francois Aucamp 19ba1402be - Update to version 0.5
- Removed "large_cover_images" patch; included upstream
- Removed "config_dialog_layout" patch; included upstream
- Updated "fedora_paths" patch
- Updated "start_amarok" patch
- Updated "theme_howto" patch
- Updated amarok integration script
2007-03-29 10:47:50 +00:00

66 lines
1.9 KiB
Diff

diff -uNr amarokFS-0.5/amfs-xml.cpp amarokFS-0.5-mod/amfs-xml.cpp
--- amarokFS-0.5/amfs-xml.cpp 2007-03-19 14:35:38.000000000 +0200
+++ amarokFS-0.5-mod/amfs-xml.cpp 2007-03-29 10:26:05.000000000 +0200
@@ -16,6 +16,7 @@
#include <qmessagebox.h>
#include <qerrormessage.h>
#include <qregexp.h>
+#include <qprocess.h>
using namespace std;
@@ -23,7 +24,7 @@
AmfsXML::AmfsXML( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl ) {
-
+ startedAmarok = false;
progressBar = (QProgressBar *) 0;
cdcover = (QLabel *) 0;
gradient = (QLabel *) 0;
@@ -439,6 +440,20 @@
mouseTimer->start( 5000, TRUE );
setMouseTracking(TRUE);
+
+ //start Amarok (if necessary)
+ if (!dcopClient->isApplicationRegistered("amarok")) {
+ QProcess *amarokProc = new QProcess(QString("amarok"));
+ if (!amarokProc->launch(QString::null)) {
+ qDebug("error starting Amarok.");
+ } else {
+ while (!dcopClient->isApplicationRegistered("amarok"))
+ qApp->processEvents();
+ usleep(100);
+ startedAmarok = true;
+ }
+ delete amarokProc;
+ }
nowPlaying = "";
updateTrackLabels();
@@ -472,6 +487,11 @@
if(isSetDisScrSvr) restoreScreenSaver();
//restore OSD if it was disabled
if(isSetDisAmaOSD) restoreAmarokOSD();
+ //stop Amarok (if it was started by AmarokFS)
+ if (startedAmarok) {
+ if (!dcopClient->send("amarok", "MainApplication-Interface", "quit()", (QByteArray) 0))
+ qDebug("there was some error using DCOP.");
+ }
ce->accept();
return;
}
diff -uNr amarokFS-0.5/amfs-xml.h amarokFS-0.5-mod/amfs-xml.h
--- amarokFS-0.5/amfs-xml.h 2007-03-19 13:59:03.000000000 +0200
+++ amarokFS-0.5-mod/amfs-xml.h 2007-03-29 10:27:00.000000000 +0200
@@ -96,6 +96,9 @@
AmarokFS_config *configWindow;
+ //stores whether Amarok was started by AmarokFS (true) or by the user
+ bool startedAmarok;
+
private slots:
void updateTime();