int pos = -1;
if ((pos = message.indexOf(' ')) != -1)
- w->play(message.mid(pos));
+ w->play(message.mid(pos + 1));
}
AniPlayer *AniPlayer::m_instance = 0;
menu->setVisible(visible);
}
-void VideoWindow::open(bool closeOnStop)
+bool VideoWindow::open(bool closeOnStop)
{
QString dir;
);
if (file == "")
- return;
+ return false;
// open(file, closeOnStop);
play(file, closeOnStop);
+ return true;
}
-void VideoWindow::open(const QString &file, bool closeOnStop)
+bool VideoWindow::open(const QString &file, bool closeOnStop)
{
if (file == "")
- return;
+ return false;
QFileInfo fileInfo(file);
if (!fileInfo.exists())
{
menu->showMessage(tr("File %1 does not exist").arg(file));
- return;
+ return false;
}
playlist->setDirectory(fileInfo.absoluteDir());
m_closeOnStop = closeOnStop;
updateWindowTitle(fileInfo);
+ return true;
}
void VideoWindow::openUrl(const QString &urlstr)
{
if (videoPlayer->currentSource().type() == Phonon::MediaSource::Invalid)
{
- open(closeOnStop);
+ if (!open(closeOnStop))
+ return;
}
videoPlayer->play();
void toggleMenu();
void setMenuVisible(bool visible);
- void open(bool closeOnStop = false);
- void open(const QString &file, bool closeOnStop = false);
+ bool open(bool closeOnStop = false);
+ bool open(const QString &file, bool closeOnStop = false);
void openUrl(const QString &url);
void play(bool closeOnStop = false);
void play(const QString &file, bool closeOnStop = false);