Put LoadUrl for mac back.

This commit is contained in:
John Maguire 2010-06-15 21:56:33 +00:00
parent 0f8ada10d3
commit abdc2eee2e
3 changed files with 13 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class PlatformInterface {
public: public:
// Called when the application should show itself. // Called when the application should show itself.
virtual void Activate() = 0; virtual void Activate() = 0;
//virtual bool LoadUrl(const QString& url) = 0; virtual bool LoadUrl(const QString& url) = 0;
virtual ~PlatformInterface() {} virtual ~PlatformInterface() {}
}; };

View File

@ -1182,6 +1182,16 @@ void MainWindow::Activate() {
show(); show();
} }
bool MainWindow::LoadUrl(const QString& url) {
if (!QFile::exists(url))
return false;
QList<QUrl> urls;
urls << QUrl::fromLocalFile(url);
AddUrls(true, urls); // Always play now as this was a direct request from Finder.
return true;
}
void MainWindow::CheckForUpdates() { void MainWindow::CheckForUpdates() {
#ifdef Q_OS_DARWIN #ifdef Q_OS_DARWIN
mac::CheckForUpdates(); mac::CheckForUpdates();

View File

@ -87,7 +87,9 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void resizeEvent(QResizeEvent* event); void resizeEvent(QResizeEvent* event);
void closeEvent(QCloseEvent* event); void closeEvent(QCloseEvent* event);
// PlatformInterface
void Activate(); void Activate();
bool LoadUrl(const QString& url);
private slots: private slots:
void FilePathChanged(const QString& path); void FilePathChanged(const QString& path);