some improvement concerning multiple tab copies of the same file (MUSR-70)
This commit is contained in:
parent
025601269b
commit
51e257a276
@ -73,8 +73,10 @@ bool PFileWatcher::modified()
|
||||
|
||||
fFileInfo->refresh();
|
||||
|
||||
if (fFileInfo->lastModified() > fLastModified)
|
||||
if (fFileInfo->lastModified() > fLastModified) {
|
||||
fLastModified = fFileInfo->lastModified();
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -102,6 +104,7 @@ void PFileWatcher::checkIfModified()
|
||||
fFileInfo->refresh();
|
||||
|
||||
if (fFileInfo->lastModified() > fLastModified) {
|
||||
fLastModified = fFileInfo->lastModified();
|
||||
fTimerCheck->stop();
|
||||
emit changed();
|
||||
}
|
||||
|
@ -519,8 +519,28 @@ void PTextEdit::fileOpen()
|
||||
tr( fAdmin->getDefaultSavePath() ), this);
|
||||
|
||||
QStringList::Iterator it = flns.begin();
|
||||
QFileInfo finfo1, finfo2;
|
||||
QString tabFln;
|
||||
bool alreadyOpen = false;
|
||||
|
||||
while( it != flns.end() ) {
|
||||
load(*it);
|
||||
// check if the file is not already open
|
||||
finfo1.setFile(*it);
|
||||
for (int i=0; i<fTabWidget->count(); i++) {
|
||||
tabFln = *fFilenames.find( (PSubTextEdit*)fTabWidget->page(i) );
|
||||
finfo2.setFile(tabFln);
|
||||
if (finfo1.absFilePath() == finfo2.absFilePath()) {
|
||||
alreadyOpen = true;
|
||||
fTabWidget->setCurrentPage(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!alreadyOpen)
|
||||
load(*it);
|
||||
else
|
||||
fileReload();
|
||||
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user