Commit 6e55d23d authored by David Faure's avatar David Faure
Browse files

Rename isFromURL to isFromExistingURL, much less confusing.

This isn't about path vs URL, it's about new file vs existing file.
parent e1c28432
......@@ -68,7 +68,7 @@ kpDocument::kpDocument (int w, int h,
kpDocumentEnvironment *environ)
: QObject (),
m_constructorWidth (w), m_constructorHeight (h),
m_isFromURL (false),
m_isFromExistingURL (false),
m_savedAtLeastOnceBefore (false),
m_saveOptions (new kpDocumentSaveOptions ()),
m_metaInfo (new kpDocumentMetaInfo ()),
......@@ -136,18 +136,18 @@ QUrl kpDocument::url () const
//---------------------------------------------------------------------
// public
void kpDocument::setURL (const QUrl &url, bool isFromURL)
void kpDocument::setURL (const QUrl &url, bool isFromExistingURL)
{
m_url = url;
m_isFromURL = isFromURL;
m_isFromExistingURL = isFromExistingURL;
}
//---------------------------------------------------------------------
// public
bool kpDocument::isFromURL (bool checkURLStillExists) const
bool kpDocument::isFromExistingURL (bool checkURLStillExists) const
{
if (!m_isFromURL) {
if (!m_isFromExistingURL) {
return false;
}
......
......@@ -125,7 +125,7 @@ public:
bool savedAtLeastOnceBefore () const;
QUrl url () const;
void setURL (const QUrl &url, bool isFromURL);
void setURL (const QUrl &url, bool isFromExistingURL);
// Returns whether the document's image was successfully opened from
// or saved to the URL returned by url(). This is not true for a
......@@ -139,7 +139,7 @@ public:
//
// e.g. If the user types "kolourpaint doesnotexist.png" to start
// KolourPaint, this method will return false.
bool isFromURL (bool checkURLStillExists = true) const;
bool isFromExistingURL (bool checkURLStillExists = true) const;
// (will convert: empty Url --> "Untitled")
QString prettyUrl () const;
......@@ -337,7 +337,7 @@ private:
kpImage *m_image;
QUrl m_url;
bool m_isFromURL;
bool m_isFromExistingURL;
bool m_savedAtLeastOnceBefore;
kpDocumentSaveOptions *m_saveOptions;
......
......@@ -362,8 +362,8 @@ void kpMainWindow::saveProperties (KConfigGroup &configGroup)
{
// Save URL in all cases:
//
// a) d->document->isFromURL()
// b) !d->document->isFromURL() [save size in this case]
// a) d->document->isFromExistingURL()
// b) !d->document->isFromExistingURL() [save size in this case]
// i) No URL
// ii) URL (from "kolourpaint doesnotexist.png")
......@@ -377,11 +377,11 @@ void kpMainWindow::saveProperties (KConfigGroup &configGroup)
//
// Note that "kolourpaint doesexist.png" is considered to be from
// a URL even if it was deleted in the background (hence the
// "false" arg to isFromURL()). This is because the user expects
// "false" arg to isFromExistingURL()). This is because the user expects
// it to be from a URL, so when we session restore, we pop up a
// "cannot find file" dialog, instead of silently creating a new,
// blank document.
if (!d->document->isFromURL (false/*don't bother checking exists*/))
if (!d->document->isFromExistingURL (false/*don't bother checking exists*/))
{
// If we don't have a URL either:
//
......
......@@ -422,7 +422,7 @@ bool kpMainWindow::open (const QUrl &url, bool newDocSameNameIfNotExist)
newDocSameNameIfNotExist);
if (newDoc)
{
if (newDoc->isFromURL (false/*don't bother checking exists*/))
if (newDoc->isFromExistingURL (false/*don't bother checking exists*/))
addRecentURL (url);
return true;
}
......@@ -1082,7 +1082,7 @@ bool kpMainWindow::slotReload ()
{
int result = KMessageBox::Cancel;
if (d->document->isFromURL (false/*don't bother checking exists*/) && !oldURL.isEmpty ())
if (d->document->isFromExistingURL (false/*don't bother checking exists*/) && !oldURL.isEmpty ())
{
result = KMessageBox::warningContinueCancel (this,
i18n ("The document \"%1\" has been modified.\n"
......@@ -1112,7 +1112,7 @@ bool kpMainWindow::slotReload ()
kpDocument *doc = nullptr;
// If it's _supposed to_ come from a URL or it exists
if (d->document->isFromURL (false/*don't bother checking exists*/) ||
if (d->document->isFromExistingURL (false/*don't bother checking exists*/) ||
(!oldURL.isEmpty () && KIO::NetAccess::exists (oldURL, KIO::NetAccess::SourceSide/*open*/, this)))
{
#if DEBUG_KP_MAIN_WINDOW
......@@ -1413,7 +1413,7 @@ void kpMainWindow::slotMail ()
toolEndShape ();
if (d->document->url ().isEmpty ()/*no name*/ ||
!d->document->isFromURL () ||
!d->document->isFromExistingURL () ||
d->document->isModified ()/*needs to be saved*/)
{
int result = KMessageBox::questionYesNo (this,
......
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