summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 6163af8..2d051a7 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -35,8 +35,8 @@
#include <kglobal.h>
#include <kapplication.h>
-#include <qregexp.h>
-#include <qtimer.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
// use a vector so we can use a sort functor
#include <vector>
@@ -45,7 +45,7 @@
using Tellico::Data::Document;
Document* Document::s_self = 0;
-Document::Document() : QObject(), m_coll(0), m_isModified(false),
+Document::Document() : TQObject(), m_coll(0), m_isModified(false),
m_loadAllImages(false), m_validFile(false), m_importer(0), m_cancelImageWriting(false),
m_fileFormat(Import::TellicoImporter::Unknown) {
m_allImagesOnDisk = Config::imageLocation() != Config::ImagesInFile;
@@ -143,7 +143,7 @@ bool Document::openDocument(const KURL& url_) {
// }
if(m_importer->hasImages()) {
m_cancelImageWriting = false;
- QTimer::singleShot(500, this, SLOT(slotLoadAllImages()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotLoadAllImages()));
} else {
emit signalCollectionImagesLoaded(m_coll);
}
@@ -155,7 +155,7 @@ bool Document::saveModified() {
if(m_isModified) {
MainWindow* app = static_cast<MainWindow*>(Kernel::self()->widget());
- QString str = i18n("The current file has been modified.\n"
+ TQString str = i18n("The current file has been modified.\n"
"Do you want to save it?");
int want_save = KMessageBox::warningYesNoCancel(Kernel::self()->widget(), str, i18n("Unsaved Changes"),
KStdGuiItem::save(), KStdGuiItem::discard());
@@ -387,7 +387,7 @@ void Document::unMergeCollection(CollPtr coll_, FieldVec origFields_, MergePair
m_coll->blockSignals(true);
- QStringList origFieldNames;
+ TQStringList origFieldNames;
for(FieldVec::Iterator field = origFields_.begin(); field != origFields_.end(); ++field) {
m_coll->modifyField(field);
origFieldNames << field->name();
@@ -398,7 +398,7 @@ void Document::unMergeCollection(CollPtr coll_, FieldVec origFields_, MergePair
m_coll->removeEntries(entries);
// second item in pair are the entries which got modified by the original merge command
- const QString track = QString::fromLatin1("track");
+ const TQString track = TQString::tqfromLatin1("track");
PairVector trackChanges = entryPair_.second;
// need to go through them in reverse since one entry may have been modified multiple times
// first item in the pair is the entry pointer
@@ -411,7 +411,7 @@ void Document::unMergeCollection(CollPtr coll_, FieldVec origFields_, MergePair
// don't removeField() until after removeEntry() is done
FieldVec currFields = m_coll->fields();
for(FieldVec::Iterator field = currFields.begin(); field != currFields.end(); ++field) {
- if(origFieldNames.findIndex(field->name()) == -1) {
+ if(origFieldNames.tqfindIndex(field->name()) == -1) {
m_coll->removeField(field);
}
}
@@ -423,7 +423,7 @@ bool Document::isEmpty() const {
return (!m_coll || m_coll->entries().isEmpty());
}
-bool Document::loadImage(const QString& id_) {
+bool Document::loadImage(const TQString& id_) {
// myLog() << "Document::loadImage() - id = " << id_ << endl;
if(!m_coll) {
return false;
@@ -464,14 +464,14 @@ void Document::checkOutEntry(Data::EntryPtr entry_) {
return;
}
- const QString loaned = QString::fromLatin1("loaned");
+ const TQString loaned = TQString::tqfromLatin1("loaned");
if(!m_coll->hasField(loaned)) {
FieldPtr f = new Field(loaned, i18n("Loaned"), Field::Bool);
f->setFlags(Field::AllowGrouped);
f->setCategory(i18n("Personal"));
m_coll->addField(f);
}
- entry_->setField(loaned, QString::fromLatin1("true"));
+ entry_->setField(loaned, TQString::tqfromLatin1("true"));
EntryVec vec;
vec.append(entry_);
m_coll->updateDicts(vec);
@@ -482,15 +482,15 @@ void Document::checkInEntry(Data::EntryPtr entry_) {
return;
}
- const QString loaned = QString::fromLatin1("loaned");
+ const TQString loaned = TQString::tqfromLatin1("loaned");
if(!m_coll->hasField(loaned)) {
return;
}
- entry_->setField(loaned, QString::null);
+ entry_->setField(loaned, TQString());
m_coll->updateDicts(EntryVec(entry_));
}
-void Document::renameCollection(const QString& newTitle_) {
+void Document::renameCollection(const TQString& newTitle_) {
m_coll->setTitle(newTitle_);
}
@@ -498,7 +498,7 @@ void Document::renameCollection(const QString& newTitle_) {
// by loading every image, it gets pulled out of the zip file and
// copied to disk. then the zip file can be closed and not retained in memory
void Document::slotLoadAllImages() {
- QString id;
+ TQString id;
StringSet images;
Data::EntryVec entries = m_coll->entries();
Data::FieldVec imageFields = m_coll->imageFields();
@@ -534,15 +534,15 @@ void Document::slotLoadAllImages() {
void Document::writeAllImages(int cacheDir_, const KURL& localDir_) {
// images get 80 steps in saveDocument()
- const uint stepSize = 1 + QMAX(1, m_coll->entryCount()/80); // add 1 since it could round off
+ const uint stepSize = 1 + TQMAX(1, m_coll->entryCount()/80); // add 1 since it could round off
uint j = 1;
- QString oldLocalDir = ImageFactory::localDir();
+ TQString oldLocalDir = ImageFactory::localDir();
ImageFactory::setLocalDirectory(localDir_);
ImageFactory::CacheDir cacheDir = static_cast<ImageFactory::CacheDir>(cacheDir_);
- QString id;
+ TQString id;
StringSet images;
EntryVec entries = m_coll->entries();
FieldVec imageFields = m_coll->imageFields();
@@ -580,7 +580,7 @@ void Document::writeAllImages(int cacheDir_, const KURL& localDir_) {
bool Document::pruneImages() {
bool found = false;
- QString id;
+ TQString id;
StringSet images;
Data::EntryVec entries = m_coll->entries();
Data::FieldVec imageFields = m_coll->imageFields();
@@ -592,7 +592,7 @@ bool Document::pruneImages() {
}
const Data::Image& img = ImageFactory::imageById(id);
if(img.isNull()) {
- entry->setField(field, QString::null);
+ entry->setField(field, TQString());
found = true;
myDebug() << "Document::pruneImages() - removing null image for " << entry->title() << ": " << id << endl;
} else {
@@ -624,13 +624,13 @@ Tellico::Data::EntryVec Document::sortEntries(EntryVec entries_) const {
vec.push_back(e);
}
- QStringList titles = Controller::self()->sortTitles();
+ TQStringList titles = Controller::self()->sortTitles();
// have to go in reverse for sorting
for(int i = titles.count()-1; i >= 0; --i) {
if(titles[i].isEmpty()) {
continue;
}
- QString field = m_coll->fieldNameByTitle(titles[i]);
+ TQString field = m_coll->fieldNameByTitle(titles[i]);
std::sort(vec.begin(), vec.end(), EntryCmp(field));
}
@@ -663,15 +663,15 @@ void Document::removeImagesNotInCollection(EntryVec entries_, EntryVec entriesTo
StringSet imagesToRemove;
for(FieldVecIt f = fields.begin(); f != fields.end(); ++f) {
for(EntryVecIt e = entries_.begin(); e != entries_.end(); ++e) {
- QString id = e->field(f->name());
+ TQString id = e->field(f->name());
if(!id.isEmpty() && imagesToCheck.has(id) && !images.has(id)) {
imagesToRemove.add(id);
}
}
}
- const QStringList realImagesToRemove = imagesToRemove.toList();
- for(QStringList::ConstIterator it = realImagesToRemove.begin(); it != realImagesToRemove.end(); ++it) {
+ const TQStringList realImagesToRemove = imagesToRemove.toList();
+ for(TQStringList::ConstIterator it = realImagesToRemove.begin(); it != realImagesToRemove.end(); ++it) {
ImageFactory::removeImage(*it, false); // doesn't delete, just remove link
}
}