Ignore:
Timestamp:
Mar 15, 2012, 5:14:10 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer 0.7.1: vendor update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/smplayer.cpp

    r118 r121  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org>
     2    Copyright (C) 2006-2012 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    2525#include "translator.h"
    2626#include "version.h"
    27 #include "constants.h"
     27#include "config.h"
    2828#include "myclient.h"
    2929#include "clhelp.h"
     
    3131#include <QDir>
    3232#include <QApplication>
     33#include <QUrl>
    3334
    3435#include <stdio.h>
     
    5253        close_at_end = -1; // Not set
    5354        start_in_fullscreen = -1; // Not set
     55        use_control_server = true;
    5456
    5557        move_gui = false;
     
    8183               
    8284                if (gui_to_use.toLower() == "minigui")
    83                         main_window = new MiniGui(0);
     85                        main_window = new MiniGui(use_control_server, 0);
    8486                else
    8587                if (gui_to_use.toLower() == "mpcgui")
    86                         main_window = new MpcGui(0);
    87                 else
    88                         main_window = new DefaultGui(0);
     88                        main_window = new MpcGui(use_control_server, 0);
     89                else
     90                        main_window = new DefaultGui(use_control_server, 0);
    8991
    9092                if (move_gui) {
     
    116118        if (!pref->gui.isEmpty()) gui_to_use = pref->gui;
    117119        bool add_to_playlist = false;
    118 
    119         bool is_playlist = false;
    120120
    121121#ifdef Q_OS_WIN
     
    200200                }
    201201                else
    202                 if (argument == "-playlist") {
    203                         is_playlist = true;
    204                 }
    205                 else
    206202                if ((argument == "--help") || (argument == "-help") ||
    207203            (argument == "-h") || (argument == "-?") )
     
    226222                }
    227223                else
     224                if (argument == "-disable-server") {
     225                        use_control_server = false;
     226                }
     227                else
    228228                if (argument == "-add-to-playlist") {
    229229                        add_to_playlist = true;
     
    243243                else {
    244244                        // File
     245                        #if QT_VERSION >= 0x040600
     246                        QUrl fUrl = QUrl::fromUserInput(argument);
     247                        if (fUrl.isValid() && fUrl.scheme().toLower() == "file") {
     248                            argument = fUrl.toLocalFile();
     249                        }
     250                        #endif
    245251                        if (QFile::exists( argument )) {
    246252                                argument = QFileInfo(argument).absoluteFilePath();
    247                         }
    248                         if (is_playlist) {
    249                                 argument = argument + IS_PLAYLIST_TAG;
    250                                 is_playlist = false;
    251253                        }
    252254                        files_to_play.append( argument );
     
    346348                        qWarning("SMPlayer::createConfigDirectory: can't create %s", Paths::configPath().toUtf8().data());
    347349                }
     350                // Screenshot folder already created in preferences.cpp if Qt >= 4.4
     351                #if QT_VERSION < 0x040400
    348352                QString s = Paths::configPath() + "/screenshots";
    349353                if (!d.mkdir(s)) {
    350354                        qWarning("SMPlayer::createHomeDirectory: can't create %s", s.toUtf8().data());
    351355                }
     356                #endif
    352357        }
    353358}
Note: See TracChangeset for help on using the changeset viewer.