Merge branch 'KDE/4.14' into master

This commit is contained in:
Sergio Martins 2014-10-01 23:57:42 +01:00
commit 9ff5451f1f
3 changed files with 24 additions and 0 deletions

View file

@ -156,6 +156,11 @@ Status main(const QStringList &paths, const QString &serializedOptions)
}
Shell* shell = new Shell( serializedOptions );
if ( !shell->isValid() )
{
return Error;
}
shell->show();
for ( int i = 0; i < paths.count(); )
{
@ -168,6 +173,10 @@ Status main(const QStringList &paths, const QString &serializedOptions)
else
{
shell = new Shell( serializedOptions );
if ( !shell->isValid() )
{
return Error;
}
shell->show();
}
}

View file

@ -64,6 +64,7 @@ Shell::Shell( const QString &serializedOptions )
#ifdef KActivities_FOUND
, m_activityResource(0)
#endif
, m_isValid(true)
{
setObjectName( QLatin1String( "okular::Shell" ) );
setContextMenuPolicy( Qt::NoContextMenu );
@ -79,6 +80,7 @@ Shell::Shell( const QString &serializedOptions )
{
// if we couldn't find our Part, we exit since the Shell by
// itself can't do anything useful
m_isValid = false;
KMessageBox::error(this, i18n("Unable to find the Okular component."));
return;
}
@ -130,10 +132,16 @@ Shell::Shell( const QString &serializedOptions )
}
else
{
m_isValid = false;
KMessageBox::error(this, i18n("Unable to find the Okular component."));
}
}
bool Shell::isValid() const
{
return m_isValid;
}
void Shell::showOpenRecentMenu()
{
m_recent->menu()->popup(QCursor::pos());

View file

@ -60,6 +60,12 @@ public:
virtual ~Shell();
QSize sizeHint() const;
/**
* Returns false if Okular component wasn't found
**/
bool isValid() const;
public slots:
void slotQuit();
@ -156,6 +162,7 @@ private:
#ifdef KActivities_FOUND
KActivities::ResourceInstance* m_activityResource;
#endif
bool m_isValid;
};
#endif