Commit 7879d593 authored by Golnaz Nilieh's avatar Golnaz Nilieh

When no blog is selected in the toolbar, "Open in browser" does nothing to avoid crash.

svn path=/trunk/KDE/kdepim/blogilo/; revision=1072297
parent 299c1d8a
......@@ -649,11 +649,16 @@ void MainWindow::uploadMediaObject()
void MainWindow::slotOpenCurrentBlogInBrowser()
{
KUrl url( DBMan::self()->blog( mCurrentBlogId ).blogUrl() );
if(url.isValid())
KToolInvocation::invokeBrowser(url.url());
else
KMessageBox::sorry(this, i18n("Cannot find current blog URL."));
if (mCurrentBlogId > -1)
{
KUrl url( DBMan::self()->blog( mCurrentBlogId ).blogUrl() );
if(url.isValid())
KToolInvocation::invokeBrowser(url.url());
else
KMessageBox::sorry(this, i18n("Cannot find current blog URL."));
}
///TODO
///else show a massege to the user saying that a blog should be selected before.
}
#include "mainwindow.moc"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment