diff options
Diffstat (limited to 'juk/filerenamer.cpp')
-rw-r--r-- | juk/filerenamer.cpp | 256 |
1 files changed, 128 insertions, 128 deletions
diff --git a/juk/filerenamer.cpp b/juk/filerenamer.cpp index ec45a268..c1acb2ce 100644 --- a/juk/filerenamer.cpp +++ b/juk/filerenamer.cpp @@ -34,19 +34,19 @@ #include <kmessagebox.h> #include <ksimpleconfig.h> -#include <qfile.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qscrollview.h> -#include <qobjectlist.h> -#include <qtimer.h> -#include <qregexp.h> -#include <qcheckbox.h> -#include <qdir.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qsignalmapper.h> -#include <qheader.h> +#include <tqfile.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqscrollview.h> +#include <tqobjectlist.h> +#include <tqtimer.h> +#include <tqregexp.h> +#include <tqcheckbox.h> +#include <tqdir.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqsignalmapper.h> +#include <tqheader.h> #include "tag.h" #include "filehandle.h" @@ -59,17 +59,17 @@ class ConfirmationDialog : public KDialogBase { public: - ConfirmationDialog(const QMap<QString, QString> &files, - QWidget *parent = 0, const char *name = 0) + ConfirmationDialog(const TQMap<TQString, TQString> &files, + TQWidget *parent = 0, const char *name = 0) : KDialogBase(parent, name, true, i18n("Warning"), Ok | Cancel) { - QVBox *vbox = makeVBoxMainWidget(); - QHBox *hbox = new QHBox(vbox); + TQVBox *vbox = makeVBoxMainWidget(); + TQHBox *hbox = new TQHBox(vbox); - QLabel *l = new QLabel(hbox); + TQLabel *l = new TQLabel(hbox); l->setPixmap(SmallIcon("messagebox_warning", 32)); - l = new QLabel(i18n("You are about to rename the following files. " + l = new TQLabel(i18n("You are about to rename the following files. " "Are you sure you want to continue?"), hbox); hbox->setStretchFactor(l, 1); @@ -80,7 +80,7 @@ public: int lvHeight = 0; - QMap<QString, QString>::ConstIterator it = files.begin(); + TQMap<TQString, TQString>::ConstIterator it = files.begin(); for(; it != files.end(); ++it) { KListViewItem *i = it.key() != it.data() ? new KListViewItem(lv, it.key(), it.data()) @@ -103,7 +103,7 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(), { KConfigGroup config(KGlobal::config(), "FileRenamer"); - QValueList<int> categoryOrder = config.readIntListEntry("CategoryOrder"); + TQValueList<int> categoryOrder = config.readIntListEntry("CategoryOrder"); unsigned categoryCount[NumTypes] = { 0 }; // Keep track of each category encountered. // Set a default: @@ -111,7 +111,7 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(), if(categoryOrder.isEmpty()) categoryOrder << Artist << Album << Title << Track; - QValueList<int>::ConstIterator catIt = categoryOrder.constBegin(); + TQValueList<int>::ConstIterator catIt = categoryOrder.constBegin(); for(; catIt != categoryOrder.constEnd(); ++catIt) { unsigned catCount = categoryCount[*catIt]++; @@ -124,9 +124,9 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(), m_folderSeparators.resize(m_categoryOrder.count() - 1, false); - QValueList<int> checkedSeparators = config.readIntListEntry("CheckedDirSeparators"); + TQValueList<int> checkedSeparators = config.readIntListEntry("CheckedDirSeparators"); - QValueList<int>::ConstIterator it = checkedSeparators.constBegin(); + TQValueList<int>::ConstIterator it = checkedSeparators.constBegin(); for(; it != checkedSeparators.constEnd(); ++it) { unsigned index = static_cast<unsigned>(*it); if(index < m_folderSeparators.count()) @@ -137,19 +137,19 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(), m_separator = config.readEntry("Separator", " - "); } -QString ConfigCategoryReader::categoryValue(TagType type) const +TQString ConfigCategoryReader::categoryValue(TagType type) const { if(!m_currentItem) - return QString::null; + return TQString::null; Tag *tag = m_currentItem->file().tag(); switch(type) { case Track: - return QString::number(tag->track()); + return TQString::number(tag->track()); case Year: - return QString::number(tag->year()); + return TQString::number(tag->year()); case Title: return tag->title(); @@ -164,16 +164,16 @@ QString ConfigCategoryReader::categoryValue(TagType type) const return tag->genre(); default: - return QString::null; + return TQString::null; } } -QString ConfigCategoryReader::prefix(const CategoryID &category) const +TQString ConfigCategoryReader::prefix(const CategoryID &category) const { return m_options[category].prefix(); } -QString ConfigCategoryReader::suffix(const CategoryID &category) const +TQString ConfigCategoryReader::suffix(const CategoryID &category) const { return m_options[category].suffix(); } @@ -183,22 +183,22 @@ TagRenamerOptions::EmptyActions ConfigCategoryReader::emptyAction(const Category return m_options[category].emptyAction(); } -QString ConfigCategoryReader::emptyText(const CategoryID &category) const +TQString ConfigCategoryReader::emptyText(const CategoryID &category) const { return m_options[category].emptyText(); } -QValueList<CategoryID> ConfigCategoryReader::categoryOrder() const +TQValueList<CategoryID> ConfigCategoryReader::categoryOrder() const { return m_categoryOrder; } -QString ConfigCategoryReader::separator() const +TQString ConfigCategoryReader::separator() const { return m_separator; } -QString ConfigCategoryReader::musicFolder() const +TQString ConfigCategoryReader::musicFolder() const { return m_musicFolder; } @@ -224,11 +224,11 @@ bool ConfigCategoryReader::isDisabled(const CategoryID &category) const // Implementation of FileRenamerWidget // -FileRenamerWidget::FileRenamerWidget(QWidget *parent) : +FileRenamerWidget::FileRenamerWidget(TQWidget *parent) : FileRenamerBase(parent), CategoryReaderInterface(), m_exampleFromFile(false) { - QLabel *temp = new QLabel(0); + TQLabel *temp = new TQLabel(0); m_exampleText->setPaletteBackgroundColor(temp->paletteBackgroundColor()); delete temp; @@ -244,22 +244,22 @@ FileRenamerWidget::FileRenamerWidget(QWidget *parent) : // Add correct text to combo box. m_category->clear(); for(unsigned i = StartTag; i < NumTypes; ++i) { - QString category = TagRenamerOptions::tagTypeText(static_cast<TagType>(i)); + TQString category = TagRenamerOptions::tagTypeText(static_cast<TagType>(i)); m_category->insertItem(category); } - connect(m_exampleDialog, SIGNAL(signalShown()), SLOT(exampleDialogShown())); - connect(m_exampleDialog, SIGNAL(signalHidden()), SLOT(exampleDialogHidden())); - connect(m_exampleDialog, SIGNAL(dataChanged()), SLOT(dataSelected())); - connect(m_exampleDialog, SIGNAL(fileChanged(const QString &)), - this, SLOT(fileSelected(const QString &))); + connect(m_exampleDialog, TQT_SIGNAL(signalShown()), TQT_SLOT(exampleDialogShown())); + connect(m_exampleDialog, TQT_SIGNAL(signalHidden()), TQT_SLOT(exampleDialogHidden())); + connect(m_exampleDialog, TQT_SIGNAL(dataChanged()), TQT_SLOT(dataSelected())); + connect(m_exampleDialog, TQT_SIGNAL(fileChanged(const TQString &)), + this, TQT_SLOT(fileSelected(const TQString &))); exampleTextChanged(); } void FileRenamerWidget::loadConfig() { - QValueList<int> checkedSeparators; + TQValueList<int> checkedSeparators; KConfigGroup config(KGlobal::config(), "FileRenamer"); for(unsigned i = 0; i < m_rows.count(); ++i) @@ -267,14 +267,14 @@ void FileRenamerWidget::loadConfig() checkedSeparators = config.readIntListEntry("CheckedDirSeparators"); - QValueList<int>::ConstIterator it = checkedSeparators.begin(); + TQValueList<int>::ConstIterator it = checkedSeparators.begin(); for(; it != checkedSeparators.end(); ++it) { unsigned separator = static_cast<unsigned>(*it); if(separator < m_folderSwitches.count()) m_folderSwitches[separator]->setChecked(true); } - QString url = config.readPathEntry("MusicFolder", "${HOME}/music"); + TQString url = config.readPathEntry("MusicFolder", "${HOME}/music"); m_musicFolder->setURL(url); m_separator->setCurrentText(config.readEntry("Separator", " - ")); @@ -283,8 +283,8 @@ void FileRenamerWidget::loadConfig() void FileRenamerWidget::saveConfig() { KConfigGroup config(KGlobal::config(), "FileRenamer"); - QValueList<int> checkedSeparators; - QValueList<int> categoryOrder; + TQValueList<int> checkedSeparators; + TQValueList<int> categoryOrder; for(unsigned i = 0; i < m_rows.count(); ++i) { unsigned rowId = idOfPosition(i); // Write out in GUI order, not m_rows order @@ -310,8 +310,8 @@ FileRenamerWidget::~FileRenamerWidget() unsigned FileRenamerWidget::addRowCategory(TagType category) { - static QPixmap up = SmallIcon("up"); - static QPixmap down = SmallIcon("down"); + static TQPixmap up = SmallIcon("up"); + static TQPixmap down = SmallIcon("down"); // Find number of categories already of this type. unsigned categoryCount = 0; @@ -325,18 +325,18 @@ unsigned FileRenamerWidget::addRowCategory(TagType category) row.position = m_rows.count(); unsigned id = row.position; - QHBox *frame = new QHBox(m_mainFrame); + TQHBox *frame = new TQHBox(m_mainFrame); frame->setPaletteBackgroundColor(frame->paletteBackgroundColor().dark(110)); row.widget = frame; - frame->setFrameShape(QFrame::Box); + frame->setFrameShape(TQFrame::Box); frame->setLineWidth(1); frame->setMargin(3); m_mainFrame->setStretchFactor(frame, 1); - QVBox *buttons = new QVBox(frame); - buttons->setFrameStyle(QFrame::Plain | QFrame::Box); + TQVBox *buttons = new TQVBox(frame); + buttons->setFrameStyle(TQFrame::Plain | TQFrame::Box); buttons->setLineWidth(1); row.upButton = new KPushButton(buttons); @@ -347,23 +347,23 @@ unsigned FileRenamerWidget::addRowCategory(TagType category) row.upButton->setFlat(true); row.downButton->setFlat(true); - upMapper->connect(row.upButton, SIGNAL(clicked()), SLOT(map())); + upMapper->connect(row.upButton, TQT_SIGNAL(clicked()), TQT_SLOT(map())); upMapper->setMapping(row.upButton, id); - downMapper->connect(row.downButton, SIGNAL(clicked()), SLOT(map())); + downMapper->connect(row.downButton, TQT_SIGNAL(clicked()), TQT_SLOT(map())); downMapper->setMapping(row.downButton, id); - QString labelText = QString("<b>%1</b>").arg(TagRenamerOptions::tagTypeText(category)); - QLabel *label = new QLabel(labelText, frame); + TQString labelText = TQString("<b>%1</b>").arg(TagRenamerOptions::tagTypeText(category)); + TQLabel *label = new TQLabel(labelText, frame); frame->setStretchFactor(label, 1); label->setAlignment(AlignCenter); - QVBox *options = new QVBox(frame); + TQVBox *options = new TQVBox(frame); row.enableButton = new KPushButton(i18n("Remove"), options); - toggleMapper->connect(row.enableButton, SIGNAL(clicked()), SLOT(map())); + toggleMapper->connect(row.enableButton, TQT_SIGNAL(clicked()), TQT_SLOT(map())); toggleMapper->setMapping(row.enableButton, id); row.optionsButton = new KPushButton(i18n("Options"), options); - mapper->connect(row.optionsButton, SIGNAL(clicked()), SLOT(map())); + mapper->connect(row.optionsButton, TQT_SIGNAL(clicked()), TQT_SLOT(map())); mapper->setMapping(row.optionsButton, id); row.widget->show(); @@ -396,7 +396,7 @@ bool FileRenamerWidget::removeRow(unsigned id) return false; } - // Remove widget. Don't delete it since it appears QSignalMapper may still need it. + // Remove widget. Don't delete it since it appears TQSignalMapper may still need it. m_rows[id].widget->deleteLater(); m_rows[id].widget = 0; m_rows[id].enableButton = 0; @@ -448,22 +448,22 @@ bool FileRenamerWidget::removeRow(unsigned id) // We can insert another row now, make sure GUI is updated to match. m_insertCategory->setEnabled(true); - QTimer::singleShot(0, this, SLOT(exampleTextChanged())); + TQTimer::singleShot(0, this, TQT_SLOT(exampleTextChanged())); return true; } void FileRenamerWidget::addFolderSeparatorCheckbox() { - QWidget *temp = new QWidget(m_mainFrame); - QHBoxLayout *l = new QHBoxLayout(temp); + TQWidget *temp = new TQWidget(m_mainFrame); + TQHBoxLayout *l = new TQHBoxLayout(temp); - QCheckBox *cb = new QCheckBox(i18n("Insert folder separator"), temp); + TQCheckBox *cb = new TQCheckBox(i18n("Insert folder separator"), temp); m_folderSwitches.append(cb); l->addWidget(cb, 0, AlignCenter); cb->setChecked(false); - connect(cb, SIGNAL(toggled(bool)), - SLOT(exampleTextChanged())); + connect(cb, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(exampleTextChanged())); temp->show(); } @@ -471,7 +471,7 @@ void FileRenamerWidget::addFolderSeparatorCheckbox() void FileRenamerWidget::createTagRows() { KConfigGroup config(KGlobal::config(), "FileRenamer"); - QValueList<int> categoryOrder = config.readIntListEntry("CategoryOrder"); + TQValueList<int> categoryOrder = config.readIntListEntry("CategoryOrder"); if(categoryOrder.isEmpty()) categoryOrder << Artist << Album << Artist << Title << Track; @@ -480,22 +480,22 @@ void FileRenamerWidget::createTagRows() m_rows.reserve(categoryOrder.count()); m_folderSwitches.reserve(categoryOrder.count() - 1); - mapper = new QSignalMapper(this, "signal mapper"); - toggleMapper = new QSignalMapper(this, "toggle mapper"); - upMapper = new QSignalMapper(this, "up button mapper"); - downMapper = new QSignalMapper(this, "down button mapper"); + mapper = new TQSignalMapper(this, "signal mapper"); + toggleMapper = new TQSignalMapper(this, "toggle mapper"); + upMapper = new TQSignalMapper(this, "up button mapper"); + downMapper = new TQSignalMapper(this, "down button mapper"); - connect(mapper, SIGNAL(mapped(int)), SLOT(showCategoryOption(int))); - connect(toggleMapper, SIGNAL(mapped(int)), SLOT(slotRemoveRow(int))); - connect(upMapper, SIGNAL(mapped(int)), SLOT(moveItemUp(int))); - connect(downMapper, SIGNAL(mapped(int)), SLOT(moveItemDown(int))); + connect(mapper, TQT_SIGNAL(mapped(int)), TQT_SLOT(showCategoryOption(int))); + connect(toggleMapper, TQT_SIGNAL(mapped(int)), TQT_SLOT(slotRemoveRow(int))); + connect(upMapper, TQT_SIGNAL(mapped(int)), TQT_SLOT(moveItemUp(int))); + connect(downMapper, TQT_SIGNAL(mapped(int)), TQT_SLOT(moveItemDown(int))); - m_mainFrame = new QVBox(m_mainView->viewport()); + m_mainFrame = new TQVBox(m_mainView->viewport()); m_mainFrame->setMargin(10); m_mainFrame->setSpacing(5); m_mainView->addChild(m_mainFrame); - m_mainView->setResizePolicy(QScrollView::AutoOneFit); + m_mainView->setResizePolicy(TQScrollView::AutoOneFit); // OK, the deal with the categoryOrder variable is that we need to create // the rows in the order that they were saved in (the order given by categoryOrder). @@ -503,7 +503,7 @@ void FileRenamerWidget::createTagRows() // a row given the identifier, use m_rows[id].position. To find the id of a given // position, use idOfPosition(position). - QValueList<int>::ConstIterator it = categoryOrder.constBegin(); + TQValueList<int>::ConstIterator it = categoryOrder.constBegin(); for(; it != categoryOrder.constEnd(); ++it) { if(*it < StartTag || *it >= NumTypes) { @@ -523,7 +523,7 @@ void FileRenamerWidget::createTagRows() // Insert the directory separator checkbox if this isn't the last // item. - QValueList<int>::ConstIterator dup(it); + TQValueList<int>::ConstIterator dup(it); // Check for last item if(++dup != categoryOrder.constEnd()) @@ -553,17 +553,17 @@ void FileRenamerWidget::exampleTextChanged() m_exampleText->setText(FileRenamer::fileName(*this) + ".mp3"); } -QString FileRenamerWidget::fileCategoryValue(TagType category) const +TQString FileRenamerWidget::fileCategoryValue(TagType category) const { FileHandle file(m_exampleFile); Tag *tag = file.tag(); switch(category) { case Track: - return QString::number(tag->track()); + return TQString::number(tag->track()); case Year: - return QString::number(tag->year()); + return TQString::number(tag->year()); case Title: return tag->title(); @@ -578,11 +578,11 @@ QString FileRenamerWidget::fileCategoryValue(TagType category) const return tag->genre(); default: - return QString::null; + return TQString::null; } } -QString FileRenamerWidget::categoryValue(TagType category) const +TQString FileRenamerWidget::categoryValue(TagType category) const { if(m_exampleFromFile) return fileCategoryValue(category); @@ -609,13 +609,13 @@ QString FileRenamerWidget::categoryValue(TagType category) const return example->m_exampleGenre->text(); default: - return QString::null; + return TQString::null; } } -QValueList<CategoryID> FileRenamerWidget::categoryOrder() const +TQValueList<CategoryID> FileRenamerWidget::categoryOrder() const { - QValueList<CategoryID> list; + TQValueList<CategoryID> list; // Iterate in GUI row order. for(unsigned i = 0; i < m_rows.count(); ++i) { @@ -636,7 +636,7 @@ bool FileRenamerWidget::hasFolderSeparator(unsigned index) const void FileRenamerWidget::moveItem(unsigned id, MovementDirection direction) { - QWidget *l = m_rows[id].widget; + TQWidget *l = m_rows[id].widget; unsigned bottom = m_rows.count() - 1; unsigned pos = m_rows[id].position; unsigned newPos = (direction == MoveUp) ? pos - 1 : pos + 1; @@ -666,7 +666,7 @@ void FileRenamerWidget::moveItem(unsigned id, MovementDirection direction) // This is the item we're swapping with. unsigned idSwitchWith = idOfPosition(newPos); - QWidget *w = m_rows[idSwitchWith].widget; + TQWidget *w = m_rows[idSwitchWith].widget; // Update the table of widget rows. @@ -675,7 +675,7 @@ void FileRenamerWidget::moveItem(unsigned id, MovementDirection direction) // Move the item two spaces above/below its previous position. It has to // be 2 spaces because of the checkbox. - QBoxLayout *layout = dynamic_cast<QBoxLayout *>(m_mainFrame->layout()); + TQBoxLayout *layout = dynamic_cast<TQBoxLayout *>(m_mainFrame->layout()); layout->remove(l); layout->insertWidget(2 * newPos, l); @@ -687,7 +687,7 @@ void FileRenamerWidget::moveItem(unsigned id, MovementDirection direction) layout->insertWidget(2 * pos, w); layout->invalidate(); - QTimer::singleShot(0, this, SLOT(exampleTextChanged())); + TQTimer::singleShot(0, this, TQT_SLOT(exampleTextChanged())); } unsigned FileRenamerWidget::idOfPosition(unsigned position) const @@ -734,7 +734,7 @@ void FileRenamerWidget::showCategoryOption(int id) { TagOptionsDialog *dialog = new TagOptionsDialog(this, m_rows[id].options, m_rows[id].category.categoryNumber); - if(dialog->exec() == QDialog::Accepted) { + if(dialog->exec() == TQDialog::Accepted) { m_rows[id].options = dialog->options(); exampleTextChanged(); } @@ -796,7 +796,7 @@ void FileRenamerWidget::exampleDialogHidden() m_showExample->setText(i18n("Show Renamer Test Dialog")); } -void FileRenamerWidget::fileSelected(const QString &file) +void FileRenamerWidget::fileSelected(const TQString &file) { m_exampleFromFile = true; m_exampleFile = file; @@ -809,12 +809,12 @@ void FileRenamerWidget::dataSelected() exampleTextChanged(); } -QString FileRenamerWidget::separator() const +TQString FileRenamerWidget::separator() const { return m_separator->currentText(); } -QString FileRenamerWidget::musicFolder() const +TQString FileRenamerWidget::musicFolder() const { return m_musicFolder->url(); } @@ -845,15 +845,15 @@ void FileRenamer::rename(PlaylistItem *item) void FileRenamer::rename(const PlaylistItemList &items) { ConfigCategoryReader reader; - QStringList errorFiles; - QMap<QString, QString> map; - QMap<QString, PlaylistItem *> itemMap; + TQStringList errorFiles; + TQMap<TQString, TQString> map; + TQMap<TQString, PlaylistItem *> itemMap; for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it) { reader.setPlaylistItem(*it); - QString oldFile = (*it)->file().absFilePath(); - QString extension = (*it)->file().fileInfo().extension(false); - QString newFile = fileName(reader) + "." + extension; + TQString oldFile = (*it)->file().absFilePath(); + TQString extension = (*it)->file().fileInfo().extension(false); + TQString newFile = fileName(reader) + "." + extension; if(oldFile != newFile) { map[oldFile] = newFile; @@ -861,11 +861,11 @@ void FileRenamer::rename(const PlaylistItemList &items) } } - if(itemMap.isEmpty() || ConfirmationDialog(map).exec() != QDialog::Accepted) + if(itemMap.isEmpty() || ConfirmationDialog(map).exec() != TQDialog::Accepted) return; KApplication::setOverrideCursor(Qt::waitCursor); - for(QMap<QString, QString>::ConstIterator it = map.begin(); + for(TQMap<TQString, TQString>::ConstIterator it = map.begin(); it != map.end(); ++it) { if(moveFile(it.key(), it.data())) { @@ -885,7 +885,7 @@ void FileRenamer::rename(const PlaylistItemList &items) KMessageBox::errorList(0, i18n("The following rename operations failed:\n"), errorFiles); } -bool FileRenamer::moveFile(const QString &src, const QString &dest) +bool FileRenamer::moveFile(const TQString &src, const TQString &dest) { kdDebug(65432) << "Moving file " << src << " to " << dest << endl; @@ -906,7 +906,7 @@ bool FileRenamer::moveFile(const QString &src, const QString &dest) // Get just the directory. KURL dir = dstURL; - dir.setFileName(QString::null); + dir.setFileName(TQString::null); // Create the directory. if(!KStandardDirs::exists(dir.path())) @@ -932,27 +932,27 @@ void FileRenamer::setFolderIcon(const KURL &dst, const PlaylistItem *item) // Split path, and go through each path element. If a path element has // the album information, set its folder icon. - QStringList elements = QStringList::split("/", dstURL.directory()); - QString path; + TQStringList elements = TQStringList::split("/", dstURL.directory()); + TQString path; - for(QStringList::ConstIterator it = elements.begin(); it != elements.end(); ++it) { + for(TQStringList::ConstIterator it = elements.begin(); it != elements.end(); ++it) { path.append("/" + (*it)); kdDebug() << "Checking path: " << path << endl; if((*it).find(item->file().tag()->album()) != -1 && - !QFile::exists(path + "/.directory")) + !TQFile::exists(path + "/.directory")) { // Seems to be a match, let's set the folder icon for the current // path. First we should write out the file. - QPixmap thumb = item->file().coverInfo()->pixmap(CoverInfo::Thumbnail); + TQPixmap thumb = item->file().coverInfo()->pixmap(CoverInfo::Thumbnail); thumb.save(path + "/.juk-thumbnail.png", "PNG"); KSimpleConfig config(path + "/.directory"); config.setGroup("Desktop Entry"); if(!config.hasKey("Icon")) { - config.writeEntry("Icon", QString("%1/.juk-thumbnail.png").arg(path)); + config.writeEntry("Icon", TQString("%1/.juk-thumbnail.png").arg(path)); config.sync(); } @@ -965,11 +965,11 @@ void FileRenamer::setFolderIcon(const KURL &dst, const PlaylistItem *item) * Returns iterator pointing to the last item enabled in the given list with * a non-empty value (or is required to be included). */ -QValueList<CategoryID>::ConstIterator lastEnabledItem(const QValueList<CategoryID> &list, +TQValueList<CategoryID>::ConstIterator lastEnabledItem(const TQValueList<CategoryID> &list, const CategoryReaderInterface &interface) { - QValueList<CategoryID>::ConstIterator it = list.constBegin(); - QValueList<CategoryID>::ConstIterator last = list.constEnd(); + TQValueList<CategoryID>::ConstIterator it = list.constBegin(); + TQValueList<CategoryID>::ConstIterator last = list.constEnd(); for(; it != list.constEnd(); ++it) { if(interface.isRequired(*it) || (!interface.isDisabled(*it) && @@ -982,21 +982,21 @@ QValueList<CategoryID>::ConstIterator lastEnabledItem(const QValueList<CategoryI return last; } -QString FileRenamer::fileName(const CategoryReaderInterface &interface) +TQString FileRenamer::fileName(const CategoryReaderInterface &interface) { - const QValueList<CategoryID> categoryOrder = interface.categoryOrder(); - const QString separator = interface.separator(); - const QString folder = interface.musicFolder(); - QValueList<CategoryID>::ConstIterator lastEnabled; + const TQValueList<CategoryID> categoryOrder = interface.categoryOrder(); + const TQString separator = interface.separator(); + const TQString folder = interface.musicFolder(); + TQValueList<CategoryID>::ConstIterator lastEnabled; unsigned i = 0; - QStringList list; - QChar dirSeparator = QChar(QDir::separator()); + TQStringList list; + TQChar dirSeparator = TQChar(TQDir::separator()); // Use lastEnabled to properly handle folder separators. lastEnabled = lastEnabledItem(categoryOrder, interface); bool pastLast = false; // Toggles to true once we've passed lastEnabled. - for(QValueList<CategoryID>::ConstIterator it = categoryOrder.begin(); + for(TQValueList<CategoryID>::ConstIterator it = categoryOrder.begin(); it != categoryOrder.end(); ++it, ++i) { @@ -1006,7 +1006,7 @@ QString FileRenamer::fileName(const CategoryReaderInterface &interface) if(interface.isDisabled(*it)) continue; - QString value = interface.value(*it); + TQString value = interface.value(*it); // The user can use the folder separator checkbox to add folders, so don't allow // slashes that slip in to accidentally create new folders. Should we filter this @@ -1023,9 +1023,9 @@ QString FileRenamer::fileName(const CategoryReaderInterface &interface) // Construct a single string representation, handling strings ending in // '/' specially - QString result; + TQString result; - for(QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); /* Empty */) { + for(TQStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); /* Empty */) { result += *it; ++it; // Manually advance iterator to check for end-of-list. @@ -1039,7 +1039,7 @@ QString FileRenamer::fileName(const CategoryReaderInterface &interface) } } - return QString(folder + dirSeparator + result); + return TQString(folder + dirSeparator + result); } #include "filerenamer.moc" |