diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:34:15 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:34:15 -0600 |
commit | 031454e56009d576589c28757f6c6fcf4884095e (patch) | |
tree | ad4c9959d05a814c9090e8fe63ba27057903271b /src/fetch/gcstarpluginfetcher.cpp | |
parent | 54011e0e1af8cd96162160ecf5d361a59a2c733e (diff) | |
download | tellico-031454e56009d576589c28757f6c6fcf4884095e.tar.gz tellico-031454e56009d576589c28757f6c6fcf4884095e.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'src/fetch/gcstarpluginfetcher.cpp')
-rw-r--r-- | src/fetch/gcstarpluginfetcher.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/fetch/gcstarpluginfetcher.cpp b/src/fetch/gcstarpluginfetcher.cpp index ccb963d..a1f6140 100644 --- a/src/fetch/gcstarpluginfetcher.cpp +++ b/src/fetch/gcstarpluginfetcher.cpp @@ -32,7 +32,7 @@ #include <kaccelmanager.h> #include <tqdir.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqwhatsthis.h> @@ -45,23 +45,23 @@ GCstarPluginFetcher::PluginParse GCstarPluginFetcher::pluginParse = NotYet; GCstarPluginFetcher::PluginList GCstarPluginFetcher::plugins(int collType_) { if(!pluginMap.contains(collType_)) { GUI::CursorSaver cs; - TQString gcstar = KStandardDirs::findExe(TQString::tqfromLatin1("gcstar")); + TQString gcstar = KStandardDirs::findExe(TQString::fromLatin1("gcstar")); if(pluginParse == NotYet) { KProcIO proc; - proc << gcstar << TQString::tqfromLatin1("--version"); + proc << gcstar << TQString::fromLatin1("--version"); // wait 5 seconds at most, just a sanity thing, never want to block completely if(proc.start(KProcess::Block) && proc.wait(5)) { TQString output; proc.readln(output); if(!output.isEmpty()) { // always going to be x.y[.z] ? - TQRegExp versionRx(TQString::tqfromLatin1("(\\d+)\\.(\\d+)(?:\\.(\\d+))?")); + TQRegExp versionRx(TQString::fromLatin1("(\\d+)\\.(\\d+)(?:\\.(\\d+))?")); if(versionRx.search(output) > -1) { int x = versionRx.cap(1).toInt(); int y = versionRx.cap(2).toInt(); int z = versionRx.cap(3).toInt(); // ok to be empty - myDebug() << TQString::tqfromLatin1("GCstarPluginFetcher() - found %1.%2.%3").tqarg(x).tqarg(y).tqarg(z) << endl; + myDebug() << TQString::fromLatin1("GCstarPluginFetcher() - found %1.%2.%3").arg(x).arg(y).arg(z) << endl; // --list-plugins argument was added for 1.3 release pluginParse = (x >= 1 && y >=3) ? New : Old; } @@ -94,9 +94,9 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) KProcIO proc; proc << gcstar_ - << TQString::tqfromLatin1("-x") - << TQString::tqfromLatin1("--list-plugins") - << TQString::tqfromLatin1("--collection") << gcstarCollection; + << TQString::fromLatin1("-x") + << TQString::fromLatin1("--list-plugins") + << TQString::fromLatin1("--collection") << gcstarCollection; if(!proc.start(KProcess::Block)) { myWarning() << "GCstarPluginFetcher::readPluginsNew() - can't start" << endl; @@ -117,10 +117,10 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) // authors have \t at beginning line = line.stripWhiteSpace(); if(!hasName) { - info.insert(TQString::tqfromLatin1("name"), line); + info.insert(TQString::fromLatin1("name"), line); hasName = true; } else { - info.insert(TQString::tqfromLatin1("author"), line); + info.insert(TQString::fromLatin1("author"), line); } // myDebug() << line << endl; } @@ -130,10 +130,10 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) } void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_) { - TQDir dir(gcstar_, TQString::tqfromLatin1("GC*.pm")); - dir.cd(TQString::tqfromLatin1("../../lib/gcstar/GCPlugins/")); + TQDir dir(gcstar_, TQString::fromLatin1("GC*.pm")); + dir.cd(TQString::fromLatin1("../../lib/gcstar/GCPlugins/")); - TQRegExp rx(TQString::tqfromLatin1("get(Name|Author|Lang)\\s*\\{\\s*return\\s+['\"](.+)['\"]")); + TQRegExp rx(TQString::fromLatin1("get(Name|Author|Lang)\\s*\\{\\s*return\\s+['\"](.+)['\"]")); rx.setMinimal(true); PluginList plugins; @@ -156,7 +156,7 @@ void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_) info.insert(rx.cap(1).lower(), rx.cap(2)); } // only add if it has a name - if(info.contains(TQString::tqfromLatin1("name"))) { + if(info.contains(TQString::fromLatin1("name"))) { plugins << info; } } @@ -166,13 +166,13 @@ void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_) TQString GCstarPluginFetcher::gcstarType(int collType_) { switch(collType_) { - case Data::Collection::Book: return TQString::tqfromLatin1("GCbooks"); - case Data::Collection::Video: return TQString::tqfromLatin1("GCfilms"); - case Data::Collection::Game: return TQString::tqfromLatin1("GCgames"); - case Data::Collection::Album: return TQString::tqfromLatin1("GCmusics"); - case Data::Collection::Coin: return TQString::tqfromLatin1("GCcoins"); - case Data::Collection::Wine: return TQString::tqfromLatin1("GCwines"); - case Data::Collection::BoardGame: return TQString::tqfromLatin1("GCboardgames"); + case Data::Collection::Book: return TQString::fromLatin1("GCbooks"); + case Data::Collection::Video: return TQString::fromLatin1("GCfilms"); + case Data::Collection::Game: return TQString::fromLatin1("GCgames"); + case Data::Collection::Album: return TQString::fromLatin1("GCmusics"); + case Data::Collection::Coin: return TQString::fromLatin1("GCcoins"); + case Data::Collection::Wine: return TQString::fromLatin1("GCwines"); + case Data::Collection::BoardGame: return TQString::fromLatin1("GCboardgames"); default: break; } return TQString(); @@ -213,7 +213,7 @@ void GCstarPluginFetcher::search(FetchKey key_, const TQString& value_) { return; } - TQString gcstar = KStandardDirs::findExe(TQString::tqfromLatin1("gcstar")); + TQString gcstar = KStandardDirs::findExe(TQString::fromLatin1("gcstar")); if(gcstar.isEmpty()) { myWarning() << "GCstarPluginFetcher::search() - gcstar not found!" << endl; stop(); @@ -233,11 +233,11 @@ void GCstarPluginFetcher::search(FetchKey key_, const TQString& value_) { connect(m_process, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), TQT_SLOT(slotError(KProcess*, char*, int))); connect(m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(slotProcessExited(KProcess*))); TQStringList args; - args << gcstar << TQString::tqfromLatin1("-x") - << TQString::tqfromLatin1("--collection") << gcstarCollection - << TQString::tqfromLatin1("--export") << TQString::tqfromLatin1("Tellico") - << TQString::tqfromLatin1("--website") << m_plugin - << TQString::tqfromLatin1("--download") << KProcess::quote(value_); + args << gcstar << TQString::fromLatin1("-x") + << TQString::fromLatin1("--collection") << gcstarCollection + << TQString::fromLatin1("--export") << TQString::fromLatin1("Tellico") + << TQString::fromLatin1("--website") << m_plugin + << TQString::fromLatin1("--download") << KProcess::quote(value_); myLog() << "GCstarPluginFetcher::search() - " << args.join(TQChar(' ')) << endl; *m_process << args; if(!m_process->start(KProcess::NotifyOnExit, KProcess::AllOutput)) { @@ -268,7 +268,7 @@ void GCstarPluginFetcher::slotData(KProcess*, char* buffer_, int len_) { void GCstarPluginFetcher::slotError(KProcess*, char* buffer_, int len_) { TQString msg = TQString::fromLocal8Bit(buffer_, len_); - msg.prepend(source() + TQString::tqfromLatin1(": ")); + msg.prepend(source() + TQString::fromLatin1(": ")); myDebug() << "GCstarPluginFetcher::slotError() - " << msg << endl; m_errors << msg; } @@ -298,7 +298,7 @@ void GCstarPluginFetcher::slotProcessExited(KProcess*) { Data::CollPtr coll = imp.collection(); if(!coll) { if(!imp.statusMessage().isEmpty()) { - message(imp.statusMessage(), MessageHandler::tqStatus); + message(imp.statusMessage(), MessageHandler::Status); } myDebug() << "GCstarPluginFetcher::slotProcessExited() - "<< source() << ": no collection pointer" << endl; stop(); @@ -311,56 +311,56 @@ void GCstarPluginFetcher::slotProcessExited(KProcess*) { switch(coll->type()) { case Data::Collection::Book: case Data::Collection::Bibtex: - desc = entry->field(TQString::tqfromLatin1("author")) + desc = entry->field(TQString::fromLatin1("author")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("publisher")); - if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) { - desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year")); - } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){ - desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year")); + + entry->field(TQString::fromLatin1("publisher")); + if(!entry->field(TQString::fromLatin1("cr_year")).isEmpty()) { + desc += TQChar('/') + entry->field(TQString::fromLatin1("cr_year")); + } else if(!entry->field(TQString::fromLatin1("pub_year")).isEmpty()){ + desc += TQChar('/') + entry->field(TQString::fromLatin1("pub_year")); } break; case Data::Collection::Video: - desc = entry->field(TQString::tqfromLatin1("studio")) + desc = entry->field(TQString::fromLatin1("studio")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("director")) + + entry->field(TQString::fromLatin1("director")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")) + + entry->field(TQString::fromLatin1("year")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("medium")); + + entry->field(TQString::fromLatin1("medium")); break; case Data::Collection::Album: - desc = entry->field(TQString::tqfromLatin1("artist")) + desc = entry->field(TQString::fromLatin1("artist")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("label")) + + entry->field(TQString::fromLatin1("label")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; case Data::Collection::Game: - desc = entry->field(TQString::tqfromLatin1("platform")); + desc = entry->field(TQString::fromLatin1("platform")); break; case Data::Collection::ComicBook: - desc = entry->field(TQString::tqfromLatin1("publisher")) + desc = entry->field(TQString::fromLatin1("publisher")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("pub_year")); + + entry->field(TQString::fromLatin1("pub_year")); break; case Data::Collection::BoardGame: - desc = entry->field(TQString::tqfromLatin1("designer")) + desc = entry->field(TQString::fromLatin1("designer")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("publisher")) + + entry->field(TQString::fromLatin1("publisher")) + TQChar('/') - + entry->field(TQString::tqfromLatin1("year")); + + entry->field(TQString::fromLatin1("year")); break; default: break; } - SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn"))); + SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::fromLatin1("isbn"))); m_entries.insert(r->uid, entry); emit signalResultFound(r); } @@ -373,7 +373,7 @@ Tellico::Data::EntryPtr GCstarPluginFetcher::fetchEntry(uint uid_) { void GCstarPluginFetcher::updateEntry(Data::EntryPtr entry_) { // ry searching for title and rely on Collection::sameEntry() to figure things out - TQString t = entry_->field(TQString::tqfromLatin1("title")); + TQString t = entry_->field(TQString::fromLatin1("title")); if(!t.isEmpty()) { search(Fetch::Title, t); return; @@ -449,7 +449,7 @@ void GCstarPluginFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) { } TQString GCstarPluginFetcher::ConfigWidget::preferredName() const { - return TQString::tqfromLatin1("GCstar - ") + m_pluginCombo->currentText(); + return TQString::fromLatin1("GCstar - ") + m_pluginCombo->currentText(); } void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() { @@ -458,7 +458,7 @@ void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() { TQStringList pluginNames; GCstarPluginFetcher::PluginList list = GCstarPluginFetcher::plugins(collType); for(GCstarPluginFetcher::PluginList::ConstIterator it = list.begin(); it != list.end(); ++it) { - pluginNames << (*it)[TQString::tqfromLatin1("name")].toString(); + pluginNames << (*it)[TQString::fromLatin1("name")].toString(); m_pluginCombo->insertItem(pluginNames.last(), *it); } slotPluginChanged(); @@ -467,8 +467,8 @@ void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() { void GCstarPluginFetcher::ConfigWidget::slotPluginChanged() { PluginInfo info = m_pluginCombo->currentData().toMap(); - m_authorLabel->setText(info[TQString::tqfromLatin1("author")].toString()); -// m_langLabel->setText(info[TQString::tqfromLatin1("lang")].toString()); + m_authorLabel->setText(info[TQString::fromLatin1("author")].toString()); +// m_langLabel->setText(info[TQString::fromLatin1("lang")].toString()); emit signalName(preferredName()); } |