2009/8/12 Darío Andrés <andresbajotie...@gmail.com>: > * Issue 1: > > In Frame, when a URL is not passed to the widget constructor it > creates an empty KUrl for "m_currentUrl" and that determines the frame > will use the "Default" image until a custom image url is set. > However, in the code, there are checks for "KUrl("Default")" which in > fact isn't there; so an empty(default) image is not detected; and this > causes some bugs (as: the "Open Image" menu option is shown and > enabled; and when it is clicked it fails as it tries to run KRun(empty > KUrl); > > Proposed fix: > Use KUrl() (empty) and KUrl::isEmpty to check for the Default image > (see attached patch)
I forgot to attach the patch...
Index: picture.cpp =================================================================== --- picture.cpp (revision 1010431) +++ picture.cpp (working copy) @@ -81,7 +81,7 @@ image = QPixmap(m_defaultImage); m_message = i18n("Loading image ..."); } else { - if (currentUrl.isEmpty() || currentUrl.path() == "Default") { + if (currentUrl.isEmpty()) { image = QPixmap(m_defaultImage); m_message = i18nc("Info", "Put your photo here or drop a folder to start a slideshow"); kDebug() << "default image ..."; Index: frame.cpp =================================================================== --- frame.cpp (revision 1010431) +++ frame.cpp (working copy) @@ -77,7 +77,7 @@ void Frame::init() { bool frameReceivedUrlArgs = false; - if (m_currentUrl != KUrl("Default")) { + if (!m_currentUrl.isEmpty()) { frameReceivedUrlArgs = true; } @@ -116,7 +116,7 @@ void Frame::updateMenu() { - bool invalidPicture = (m_currentUrl.url() == "Default") && (m_mySlideShow->currentUrl() == "Default"); + bool invalidPicture = m_currentUrl.url().isEmpty() && m_mySlideShow->currentUrl().isEmpty(); if (m_potd || invalidPicture ) { delete m_openPicture; @@ -148,7 +148,7 @@ url = m_currentUrl; } - if (url.path() != "Default") { + if (!url.path().isEmpty()) { new KRun(url, 0); } }
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel