diff options
Diffstat (limited to 'src/smplayer.cpp')
-rw-r--r-- | src/smplayer.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/smplayer.cpp b/src/smplayer.cpp index 9db8b72..62c0a08 100644 --- a/src/smplayer.cpp +++ b/src/smplayer.cpp @@ -342,6 +342,14 @@ SMPlayer::ExitCode SMPlayer::processArgs(QStringList args) { if (argument == "-defaultgui") { gui_to_use = "DefaultGUI"; } + else + if (argument == "-ontop") { + pref->stay_on_top = Preferences::AlwaysOnTop; + } + else + if (argument == "-no-ontop") { + pref->stay_on_top = Preferences::NeverOnTop; + } #ifdef SKINS else if (argument == "-skingui") { @@ -473,10 +481,20 @@ void SMPlayer::createFontFile() { } QString input = Paths::appPath() + "/mplayer/fonts/fonts.conf"; - qDebug("SMPlayer::createFontFile: input: %s", input.toLatin1().constData()); + if (!QFile::exists(input)) { + qDebug("SMPlayer::createFontFile: %s doesn't exist", input.toUtf8().constData()); + input = Paths::appPath() + "/mplayer/mpv/fonts.conf"; + if (!QFile::exists(input)) { + qDebug("SMPlayer::createFontFile: %s doesn't exist", input.toUtf8().constData()); + qWarning("SMPlayer::createFontFile: failed to create fonts.conf"); + return; + } + } + qDebug("SMPlayer::createFontFile: input: %s", input.toUtf8().constData()); QFile infile(input); if (infile.open(QIODevice::ReadOnly | QIODevice::Text)) { QString text = infile.readAll(); + text = text.replace("<!-- <dir>WINDOWSFONTDIR</dir> -->", "<dir>WINDOWSFONTDIR</dir>"); text = text.replace("<dir>WINDOWSFONTDIR</dir>", "<dir>" + Paths::fontPath() + "</dir>"); //qDebug("SMPlayer::createFontFile: %s", text.toUtf8().constData()); |