Changeset View
Changeset View
Standalone View
Standalone View
src/AmarokProcess.cpp
Show All 21 Lines | |||||
22 | #include <fcntl.h> | 22 | #include <fcntl.h> | ||
23 | #include <sys/time.h> | 23 | #include <sys/time.h> | ||
24 | #include <sys/resource.h> | 24 | #include <sys/resource.h> | ||
25 | #include <unistd.h> | 25 | #include <unistd.h> | ||
26 | 26 | | |||
27 | AmarokProcess::AmarokProcess(QObject *parent) | 27 | AmarokProcess::AmarokProcess(QObject *parent) | ||
28 | : KProcess(parent), lowPriority(false) | 28 | : KProcess(parent), lowPriority(false) | ||
29 | { | 29 | { | ||
30 | connect( this, SIGNAL(finished(int)), this, SLOT(finished()) ); | 30 | connect( this, QOverload<int>::of(&QProcess::finished), | ||
31 | connect( this, SIGNAL(readyReadStandardOutput()), this, SLOT(readyReadStandardOutput()) ); | 31 | this, QOverload<>::of(&AmarokProcess::finished) ); | ||
32 | connect( this, SIGNAL(readyReadStandardError()), this, SLOT(readyReadStandardError()) ); | 32 | connect( this, &QProcess::readyReadStandardOutput, this, &AmarokProcess::readyReadStandardOutput ); | ||
33 | connect( this, &QProcess::readyReadStandardError, this, &AmarokProcess::readyReadStandardError ); | ||||
33 | } | 34 | } | ||
34 | 35 | | |||
35 | /** | 36 | /** | ||
36 | * Due to xine-lib, we have to make KProcess close all fds, otherwise we get "device is busy" messages | 37 | * Due to xine-lib, we have to make KProcess close all fds, otherwise we get "device is busy" messages | ||
37 | * exploiting setupChildProcess(), a virtual method that | 38 | * exploiting setupChildProcess(), a virtual method that | ||
38 | * happens to be called in the forked process | 39 | * happens to be called in the forked process | ||
39 | * See bug #103750 for more information. | 40 | * See bug #103750 for more information. | ||
40 | */ | 41 | */ | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 109 | { | |||
110 | line = codec->toUnicode( bytes.data(), bytes.length() - 1); | 111 | line = codec->toUnicode( bytes.data(), bytes.length() - 1); | ||
111 | return line.length(); | 112 | return line.length(); | ||
112 | } | 113 | } | ||
113 | } | 114 | } | ||
114 | 115 | | |||
115 | void | 116 | void | ||
116 | AmarokProcIO::start() | 117 | AmarokProcIO::start() | ||
117 | { | 118 | { | ||
118 | connect (this, SIGNAL (readyReadStandardOutput()), this, SLOT (readyReadStandardOutput())); | 119 | connect (this, &AmarokProcIO::readyReadStandardOutput, this, &AmarokProcIO::readyReadStandardOutput); | ||
119 | 120 | | |||
120 | KProcess::start (); | 121 | KProcess::start (); | ||
121 | } | 122 | } | ||
122 | 123 | | |||
123 | void | 124 | void | ||
124 | AmarokProcIO::readyReadStandardOutput() | 125 | AmarokProcIO::readyReadStandardOutput() | ||
125 | { | 126 | { | ||
126 | if( canReadLine() ) | 127 | if( canReadLine() ) | ||
Show All 21 Lines |