本文整理汇总了C++中MyApplication::isRunning方法的典型用法代码示例。如果您正苦于以下问题:C++ MyApplication::isRunning方法的具体用法?C++ MyApplication::isRunning怎么用?C++ MyApplication::isRunning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyApplication
的用法示例。
在下文中一共展示了MyApplication::isRunning方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processArgs
//.........这里部分代码省略.........
}
else
if (argument == "-fullscreen") {
start_in_fullscreen = 1;
}
else
if (argument == "-no-fullscreen") {
start_in_fullscreen = 0;
}
else
if (argument == "-add-to-playlist") {
add_to_playlist = true;
}
else
if (argument == "-mini" || argument == "-minigui") {
gui_to_use = "MiniGUI";
}
else
if (argument == "-mpcgui") {
gui_to_use = "MpcGUI";
}
else
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") {
gui_to_use = "SkinGUI";
}
#endif
else {
// File
#if QT_VERSION >= 0x040600
QUrl fUrl = QUrl::fromUserInput(argument);
if (fUrl.isValid() && fUrl.scheme().toLower() == "file") {
argument = fUrl.toLocalFile();
}
#endif
if (QFile::exists( argument )) {
argument = QFileInfo(argument).absoluteFilePath();
}
files_to_play.append( argument );
}
}
if (show_help) {
printf("%s\n", CLHelp::help().toLocal8Bit().data());
return NoError;
}
qDebug("SMPlayer::processArgs: files_to_play: count: %d", files_to_play.count() );
for (int n=0; n < files_to_play.count(); n++) {
qDebug("SMPlayer::processArgs: files_to_play[%d]: '%s'", n, files_to_play[n].toUtf8().data());
}
#ifdef SINGLE_INSTANCE
if (pref->use_single_instance) {
// Single instance
MyApplication * a = MyApplication::instance();
if (a->isRunning()) {
a->sendMessage("Hello");
if (!action.isEmpty()) {
a->sendMessage("action " + action);
}
else {
if (!subtitle_file.isEmpty()) {
a->sendMessage("load_sub " + subtitle_file);
}
if (!files_to_play.isEmpty()) {
/* a->sendMessage("open_file " + files_to_play[0]); */
QString command = "open_files";
if (add_to_playlist) command = "add_to_playlist";
a->sendMessage(command +" "+ files_to_play.join(" <<sep>> "));
}
}
return NoError;
}
}
#endif
if (!pref->default_font.isEmpty()) {
QFont f;
f.fromString(pref->default_font);
qApp->setFont(f);
}
return SMPlayer::NoExit;
}