Fix parsing non-ascii filenames passed on the commandline (or through a file browser). Fixes issue #773. Fixes issue #752.
This commit is contained in:
parent
e3a9bd7b26
commit
fd00924f26
|
@ -24,6 +24,8 @@
|
|||
|
||||
#include <QBuffer>
|
||||
#include <QFileInfo>
|
||||
#include <QTextCodec>
|
||||
#include <QtDebug>
|
||||
|
||||
const char* CommandlineOptions::kHelpText =
|
||||
"%1: clementine [%2] [%3]\n"
|
||||
|
|
12
src/main.cpp
12
src/main.cpp
|
@ -180,16 +180,20 @@ int main(int argc, char *argv[]) {
|
|||
lastfm::ws::SharedSecret = LastFMService::kSecret;
|
||||
#endif
|
||||
|
||||
// Parse commandline options - need to do this before starting the
|
||||
// QApplication so it works without an X server
|
||||
CommandlineOptions options(argc, argv);
|
||||
if (!options.Parse())
|
||||
return 1;
|
||||
|
||||
{
|
||||
// Only start a core application now so we can check if there's another
|
||||
// Clementine running without needing an X server.
|
||||
// This MUST be done before parsing the commandline options so QTextCodec
|
||||
// gets the right system locale for filenames.
|
||||
QtSingleCoreApplication a(argc, argv);
|
||||
|
||||
// Parse commandline options - need to do this before starting the
|
||||
// full QApplication so it works without an X server
|
||||
if (!options.Parse())
|
||||
return 1;
|
||||
|
||||
if (a.isRunning()) {
|
||||
if (options.is_empty()) {
|
||||
qDebug() << "Clementine is already running - activating existing window";
|
||||
|
|
Loading…
Reference in New Issue