Skip to content

Commit 5f4f1fa

Browse files
committed
More cleanup
To be squashed.
1 parent 557ffb3 commit 5f4f1fa

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
6060
{
6161
if (inst.connectServer())
6262
{
63-
inst.sendMessage(QString(PROGRAM_ARG_OPEN) + parser.positionalArguments().join(','));
63+
inst.sendMessage(PROGRAM_ARG_OPEN_W_DEL + parser.positionalArguments().join(','));
6464
inst.closeSocket();
6565
return 0;
6666
}
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
7272
KokoVP w;
7373

7474
if (parser.positionalArguments().length()>0)
75-
w.handleNewMessage(QString(PROGRAM_ARG_OPEN) + parser.positionalArguments().join(','));
75+
w.handleNewMessage(PROGRAM_ARG_OPEN_W_DEL + parser.positionalArguments().join(','));
7676

7777
QObject::connect(&inst, &SingleInstance::newMessage, &w, &KokoVP::handleNewMessage);
7878
w.showNormal();

playercontroller.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ void PlayerController::handleFileEnd()
6262
}
6363
}
6464

65-
void PlayerController::open(const QUrl &url)
65+
void PlayerController::open(const QUrl &file)
6666
{
6767
if (haveFile)
6868
{
69-
queuedFile = url;
69+
queuedFile = file;
7070
return stop();
7171
}
7272
p_tracks.clear();
7373

7474
// Here we need to scan siblings folder for possible external subtitles and audio
7575
//, then set it to sub-file-paths and audio-file-paths OPTIONs (not properties)
76-
if (url.isLocalFile())
76+
if (file.isLocalFile())
7777
{
78-
QDir mediaDir = QFileInfo(url.toLocalFile()).absoluteDir();
78+
QDir mediaDir = QFileInfo(file.toLocalFile()).absoluteDir();
7979

8080
if (p_extSubMaxDepth>=0 && p_extSubMode!="no")
8181
{
@@ -94,7 +94,7 @@ void PlayerController::open(const QUrl &url)
9494
}
9595
}
9696

97-
p->command(QStringList{"loadfile", url.toString()});
97+
p->command(QStringList{"loadfile", file.toString()});
9898
}
9999

100100
void PlayerController::stop()

playercontroller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class PlayerController : public QObject
5858
void setExtSubOptions(QString mode, int depth) { p_extSubMode = mode; p_extSubMaxDepth = depth; }
5959
void setExtAudioOptions(QString mode, int depth) { p_extAudioMode = mode; p_extAudioMaxDepth = depth; }
6060

61-
void open(const QUrl &url);
61+
void open(const QUrl &file);
6262
void stop();
6363

6464
void togglePlayback();

program_arg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define PROGRAM_ARG_H
33

44
#define PROGRAM_ARG_DELIMITER ":"
5-
#define PROGRAM_ARG_OPEN "OPEN" PROGRAM_ARG_DELIMITER
5+
#define PROGRAM_ARG_OPEN "OPEN"
6+
#define PROGRAM_ARG_OPEN_W_DEL PROGRAM_ARG_OPEN PROGRAM_ARG_DELIMITER
67

78
#endif

singleinstance.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
*/
1717
#include "singleinstance.h"
1818

19-
#include <QDataStream>
2019
#include <QDebug>
2120
#include <QIODevice>
2221
#include <QLocalSocket>
2322
#include <QLocalServer>
2423
#include <qflags.h>
2524

26-
#include "program_arg.h"
2725

2826
SingleInstance::SingleInstance(QString appName, QObject *parent)
2927
: p_appName(appName), QObject{parent}

0 commit comments

Comments
 (0)