r16668 by craig - #9845: Stop the guidemanager settings docs to modified on opening. Stop updated images from setting documents to modified other than the one they are in, and no longer track recent doc files and the doc itself
scribus-commit
scribus-commit at lists.scribus.net
Thu Jun 16 19:36:10 UTC 2011
Author: craig
Date: Thu Jun 16 19:36:10 2011
New Revision: 16668
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16668
Log:
#9845: Stop the guidemanager settings docs to modified on opening. Stop updated images from setting documents to modified other than the one they are in, and no longer track recent doc files and the doc itself
Modified:
branches/Version135/Scribus/scribus/filewatcher.cpp
branches/Version135/Scribus/scribus/guidemanager.cpp
branches/Version135/Scribus/scribus/prefsmanager.cpp
branches/Version135/Scribus/scribus/scribus.cpp
branches/Version135/Scribus/scribus/scribusdoc.cpp
Modified: branches/Version135/Scribus/scribus/filewatcher.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16668&path=/branches/Version135/Scribus/scribus/filewatcher.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/filewatcher.cpp (original)
+++ branches/Version135/Scribus/scribus/filewatcher.cpp Thu Jun 16 19:36:10 2011
@@ -16,6 +16,7 @@
#define usleep(t) Sleep((t > 1000) ? (t / 1000) : 1)
#endif
+#include <QDebug>
#include <QStringList>
#include "filewatcher.h"
@@ -55,6 +56,11 @@
void FileWatcher::addFile(QString fileName)
{
+ if (fileName.isEmpty())
+ {
+ qDebug()<<"Attempt to add empty filename to filewatcher";
+ return;
+ }
watchTimer->stop();
if (!watchedFiles.contains(fileName))
{
@@ -175,13 +181,16 @@
}
}
else
- {
+ {
+ //qDebug()<<it.key();
it.value().pending = false;
time = it.value().info.lastModified();
if (time != it.value().timeInfo)
{
+ //qDebug()<<"Times different: last modified:"<<time<<"\t recorded time:"<<it.value().timeInfo;
if (it.value().info.isDir())
{
+ //qDebug()<<"dir, ignoring"<<it.key();
it.value().timeInfo = time;
if (!(m_stateFlags & FileCheckMustStop))
emit dirChanged(it.key());
@@ -192,6 +201,7 @@
usleep(100);
it.value().info.refresh();
uint sizen = it.value().info.size();
+ //qDebug()<<"Size comparison"<<sizeo<<sizen<<it.key();
while (sizen != sizeo)
{
sizeo = sizen;
Modified: branches/Version135/Scribus/scribus/guidemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16668&path=/branches/Version135/Scribus/scribus/guidemanager.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/guidemanager.cpp (original)
+++ branches/Version135/Scribus/scribus/guidemanager.cpp Thu Jun 16 19:36:10 2011
@@ -497,14 +497,16 @@
{
horizontalModel->setValues(currentPage->guides.horizontals(GuideManagerCore::Standard));
drawGuides();
- m_Doc->changed();
+//9845: why are we setting this changed, we dont in 1.5.0
+// m_Doc->changed();
}
void GuideManager::clearRestoreVerticalList()
{
verticalModel->setValues(currentPage->guides.verticals(GuideManagerCore::Standard));
drawGuides();
- m_Doc->changed();
+//9845: why are we setting this changed, we dont in 1.5.0
+// m_Doc->changed();
}
void GuideManager::deletePageButton_clicked()
Modified: branches/Version135/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16668&path=/branches/Version135/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/prefsmanager.cpp (original)
+++ branches/Version135/Scribus/scribus/prefsmanager.cpp Thu Jun 16 19:36:10 2011
@@ -910,7 +910,7 @@
if (fd.exists())
{
mw->RecentDocs.append(appPrefs.RecentDocs[m]);
- ScCore->fileWatcher->addFile(appPrefs.RecentDocs[m]);
+ //#9845: ScCore->fileWatcher->addFile(appPrefs.RecentDocs[m]);
}
}
mw->rebuildRecentFileMenu();
Modified: branches/Version135/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16668&path=/branches/Version135/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribus.cpp (original)
+++ branches/Version135/Scribus/scribus/scribus.cpp Thu Jun 16 19:36:10 2011
@@ -3404,7 +3404,8 @@
if (RecentDocs.indexOf(fn) == -1)
{
RecentDocs.prepend(fn);
- ScCore->fileWatcher->addFile(fn);
+ //#9845, why are we tracking doc changes, see also removeRecent:
+ //ScCore->fileWatcher->addFile(fn);
}
else
{
@@ -3419,8 +3420,8 @@
if (RecentDocs.indexOf(fn) != -1)
{
RecentDocs.removeAll(fn);
- if (!fromFileWatcher)
- ScCore->fileWatcher->removeFile(fn);
+ //#9845, if (!fromFileWatcher)
+ //#9845, ScCore->fileWatcher->removeFile(fn);
}
rebuildRecentFileMenu();
}
Modified: branches/Version135/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16668&path=/branches/Version135/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusdoc.cpp Thu Jun 16 19:36:10 2011
@@ -27,7 +27,7 @@
#include <sstream>
#include <QByteArray>
- #include <QDebug>
+#include <QDebug>
#include <QEventLoop>
#include <QFile>
#include <QList>
@@ -4152,7 +4152,8 @@
if (!reload)
{
QFileInfo fi(pageItem->Pfile);
- ScCore->fileWatcher->addDir(fi.absolutePath());
+ //#9845, why are we tracking dir changes when we are tracking the file itself
+ //ScCore->fileWatcher->addDir(fi.absolutePath());
ScCore->fileWatcher->addFile(pageItem->Pfile);
}
if (!isLoading())
@@ -6669,6 +6670,7 @@
//CB Same as RecalcPicturesRes apart from the name checking, which should be able to be removed
void ScribusDoc::updatePict(QString name)
{
+ bool updated=false;
for (int a = 0; a < DocItems.count(); ++a)
{
PageItem *currItem = DocItems.at(a);
@@ -6680,6 +6682,7 @@
currItem->setImageFlippedH(fho);
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
+ updated=true;
}
}
for (int a = 0; a < MasterItems.count(); ++a)
@@ -6693,6 +6696,7 @@
currItem->setImageFlippedH(fho);
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
+ updated=true;
}
}
for (int a = 0; a <FrameItems.count(); ++a)
@@ -6706,6 +6710,7 @@
currItem->setImageFlippedH(fho);
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
+ updated=true;
}
}
QStringList patterns = docPatterns.keys();
@@ -6723,17 +6728,22 @@
currItem->setImageFlippedH(fho);
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
+ updated=true;
}
}
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
}
- regionsChanged()->update(QRectF());
- changed();
+ if (updated)
+ {
+ regionsChanged()->update(QRectF());
+ changed();
+ }
}
void ScribusDoc::updatePictDir(QString name)
{
+ bool updated=false;
for (int a = 0; a < DocItems.count(); ++a)
{
PageItem *currItem = DocItems.at(a);
@@ -6753,6 +6763,7 @@
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
ScCore->fileWatcher->addFile(currItem->Pfile);
+ updated=true;
}
}
}
@@ -6777,6 +6788,7 @@
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
ScCore->fileWatcher->addFile(currItem->Pfile);
+ updated=true;
}
}
}
@@ -6801,6 +6813,7 @@
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
ScCore->fileWatcher->addFile(currItem->Pfile);
+ updated=true;
}
}
}
@@ -6829,6 +6842,7 @@
currItem->setImageFlippedV(fvo);
currItem->AdjustPictScale();
ScCore->fileWatcher->addFile(currItem->Pfile);
+ updated=true;
}
}
}
@@ -6837,8 +6851,11 @@
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
}
- regionsChanged()->update(QRectF());
- changed();
+ if (updated)
+ {
+ regionsChanged()->update(QRectF());
+ changed();
+ }
}
//CB Same as updatePict apart from the name checking, this should be able to be removed
@@ -6980,6 +6997,7 @@
void ScribusDoc::removePict(QString name)
{
+ bool updated=false;
for (int a = 0; a < DocItems.count(); ++a)
{
PageItem *currItem = DocItems.at(a);
@@ -6987,6 +7005,7 @@
{
currItem->PictureIsAvailable = false;
currItem->pixm = ScImage();
+ updated=true;
}
}
for (int a = 0; a < MasterItems.count(); ++a)
@@ -6996,6 +7015,7 @@
{
currItem->PictureIsAvailable = false;
currItem->pixm = ScImage();
+ updated=true;
}
}
for (int a = 0; a < FrameItems.count(); ++a)
@@ -7005,6 +7025,7 @@
{
currItem->PictureIsAvailable = false;
currItem->pixm = ScImage();
+ updated=true;
}
}
QStringList patterns = docPatterns.keys();
@@ -7018,15 +7039,18 @@
{
currItem->PictureIsAvailable = false;
currItem->pixm = ScImage();
+ updated=true;
}
}
PageItem *ite = pa.items.at(0);
docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(pa.items);
}
- regionsChanged()->update(QRectF());
- changed();
-}
-
+ if (updated)
+ {
+ regionsChanged()->update(QRectF());
+ changed();
+ }
+}
void ScribusDoc::updatePic()
{
More information about the scribus-commit
mailing list