summaryrefslogtreecommitdiffstats
path: root/juk/filerenamer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 06:00:15 +0000
commitb1057f437bf65300831a0ccb45b920787c6b318d (patch)
treef8a73db06ca1180d0da0ba6dfbe786197b4f4bc3 /juk/filerenamer.cpp
parent4ddfca384ced9ad654213aef9dc2c3973720b980 (diff)
downloadtdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.tar.gz
tdemultimedia-b1057f437bf65300831a0ccb45b920787c6b318d.zip
TQt4 port kdemultimedia
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1236079 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'juk/filerenamer.cpp')
-rw-r--r--juk/filerenamer.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/juk/filerenamer.cpp b/juk/filerenamer.cpp
index c1acb2ce..2155d11c 100644
--- a/juk/filerenamer.cpp
+++ b/juk/filerenamer.cpp
@@ -60,8 +60,8 @@ class ConfirmationDialog : public KDialogBase
{
public:
ConfirmationDialog(const TQMap<TQString, TQString> &files,
- TQWidget *parent = 0, const char *name = 0)
- : KDialogBase(parent, name, true, i18n("Warning"), Ok | Cancel)
+ TQWidget *tqparent = 0, const char *name = 0)
+ : KDialogBase(tqparent, name, true, i18n("Warning"), Ok | Cancel)
{
TQVBox *vbox = makeVBoxMainWidget();
TQHBox *hbox = new TQHBox(vbox);
@@ -89,8 +89,8 @@ public:
}
lvHeight += lv->horizontalScrollBar()->height() + lv->header()->height();
- lv->setMinimumHeight(QMIN(lvHeight, 400));
- resize(QMIN(width(), 500), QMIN(minimumHeight(), 400));
+ lv->setMinimumHeight(TQMIN(lvHeight, 400));
+ resize(TQMIN(width(), 500), TQMIN(minimumHeight(), 400));
}
};
@@ -140,7 +140,7 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(),
TQString ConfigCategoryReader::categoryValue(TagType type) const
{
if(!m_currentItem)
- return TQString::null;
+ return TQString();
Tag *tag = m_currentItem->file().tag();
@@ -164,7 +164,7 @@ TQString ConfigCategoryReader::categoryValue(TagType type) const
return tag->genre();
default:
- return TQString::null;
+ return TQString();
}
}
@@ -224,15 +224,15 @@ bool ConfigCategoryReader::isDisabled(const CategoryID &category) const
// Implementation of FileRenamerWidget
//
-FileRenamerWidget::FileRenamerWidget(TQWidget *parent) :
- FileRenamerBase(parent), CategoryReaderInterface(),
+FileRenamerWidget::FileRenamerWidget(TQWidget *tqparent) :
+ FileRenamerBase(tqparent), CategoryReaderInterface(),
m_exampleFromFile(false)
{
TQLabel *temp = new TQLabel(0);
m_exampleText->setPaletteBackgroundColor(temp->paletteBackgroundColor());
delete temp;
- layout()->setMargin(0); // We'll be wrapped by KDialogBase
+ tqlayout()->setMargin(0); // We'll be wrapped by KDialogBase
// This must be created before createTagRows() is called.
@@ -348,23 +348,23 @@ unsigned FileRenamerWidget::addRowCategory(TagType category)
row.downButton->setFlat(true);
upMapper->connect(row.upButton, TQT_SIGNAL(clicked()), TQT_SLOT(map()));
- upMapper->setMapping(row.upButton, id);
+ upMapper->setMapping(TQT_TQOBJECT(row.upButton), id);
downMapper->connect(row.downButton, TQT_SIGNAL(clicked()), TQT_SLOT(map()));
- downMapper->setMapping(row.downButton, id);
+ downMapper->setMapping(TQT_TQOBJECT(row.downButton), id);
- TQString labelText = TQString("<b>%1</b>").arg(TagRenamerOptions::tagTypeText(category));
+ TQString labelText = TQString("<b>%1</b>").tqarg(TagRenamerOptions::tagTypeText(category));
TQLabel *label = new TQLabel(labelText, frame);
frame->setStretchFactor(label, 1);
- label->setAlignment(AlignCenter);
+ label->tqsetAlignment(AlignCenter);
TQVBox *options = new TQVBox(frame);
row.enableButton = new KPushButton(i18n("Remove"), options);
toggleMapper->connect(row.enableButton, TQT_SIGNAL(clicked()), TQT_SLOT(map()));
- toggleMapper->setMapping(row.enableButton, id);
+ toggleMapper->setMapping(TQT_TQOBJECT(row.enableButton), id);
row.optionsButton = new KPushButton(i18n("Options"), options);
mapper->connect(row.optionsButton, TQT_SIGNAL(clicked()), TQT_SLOT(map()));
- mapper->setMapping(row.optionsButton, id);
+ mapper->setMapping(TQT_TQOBJECT(row.optionsButton), id);
row.widget->show();
m_rows.append(row);
@@ -378,10 +378,10 @@ unsigned FileRenamerWidget::addRowCategory(TagType category)
void FileRenamerWidget::moveSignalMappings(unsigned oldId, unsigned newId)
{
- mapper->setMapping(m_rows[oldId].optionsButton, newId);
- downMapper->setMapping(m_rows[oldId].downButton, newId);
- upMapper->setMapping(m_rows[oldId].upButton, newId);
- toggleMapper->setMapping(m_rows[oldId].enableButton, newId);
+ mapper->setMapping(TQT_TQOBJECT(m_rows[oldId].optionsButton), newId);
+ downMapper->setMapping(TQT_TQOBJECT(m_rows[oldId].downButton), newId);
+ upMapper->setMapping(TQT_TQOBJECT(m_rows[oldId].upButton), newId);
+ toggleMapper->setMapping(TQT_TQOBJECT(m_rows[oldId].enableButton), newId);
}
bool FileRenamerWidget::removeRow(unsigned id)
@@ -410,9 +410,9 @@ bool FileRenamerWidget::removeRow(unsigned id)
if(m_rows[id].position > 0)
checkboxPosition = m_rows[id].position - 1;
- // The checkbox is contained within a layout widget, so the layout
+ // The checkbox is contained within a tqlayout widget, so the tqlayout
// widget is the one the needs to die.
- delete m_folderSwitches[checkboxPosition]->parent();
+ delete m_folderSwitches[checkboxPosition]->tqparent();
m_folderSwitches.erase(&m_folderSwitches[checkboxPosition]);
// Go through all the rows and if they have the same category and a
@@ -480,10 +480,10 @@ void FileRenamerWidget::createTagRows()
m_rows.reserve(categoryOrder.count());
m_folderSwitches.reserve(categoryOrder.count() - 1);
- 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");
+ mapper = new TQSignalMapper(TQT_TQOBJECT(this), "signal mapper");
+ toggleMapper = new TQSignalMapper(TQT_TQOBJECT(this), "toggle mapper");
+ upMapper = new TQSignalMapper(TQT_TQOBJECT(this), "up button mapper");
+ downMapper = new TQSignalMapper(TQT_TQOBJECT(this), "down button mapper");
connect(mapper, TQT_SIGNAL(mapped(int)), TQT_SLOT(showCategoryOption(int)));
connect(toggleMapper, TQT_SIGNAL(mapped(int)), TQT_SLOT(slotRemoveRow(int)));
@@ -578,7 +578,7 @@ TQString FileRenamerWidget::fileCategoryValue(TagType category) const
return tag->genre();
default:
- return TQString::null;
+ return TQString();
}
}
@@ -609,7 +609,7 @@ TQString FileRenamerWidget::categoryValue(TagType category) const
return example->m_exampleGenre->text();
default:
- return TQString::null;
+ return TQString();
}
}
@@ -675,17 +675,17 @@ 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.
- TQBoxLayout *layout = dynamic_cast<TQBoxLayout *>(m_mainFrame->layout());
+ TQBoxLayout *tqlayout = dynamic_cast<TQBoxLayout *>(m_mainFrame->tqlayout());
- layout->remove(l);
- layout->insertWidget(2 * newPos, l);
+ tqlayout->remove(l);
+ tqlayout->insertWidget(2 * newPos, l);
// Move the top item two spaces in the opposite direction, for a similar
// reason.
- layout->remove(w);
- layout->insertWidget(2 * pos, w);
- layout->invalidate();
+ tqlayout->remove(w);
+ tqlayout->insertWidget(2 * pos, w);
+ tqlayout->tqinvalidate();
TQTimer::singleShot(0, this, TQT_SLOT(exampleTextChanged()));
}
@@ -778,7 +778,7 @@ void FileRenamerWidget::insertCategory()
// Set its down button to be disabled.
m_rows[id].downButton->setEnabled(false);
- m_mainFrame->layout()->invalidate();
+ m_mainFrame->tqlayout()->tqinvalidate();
m_mainView->update();
// Now update according to the code in loadConfig().
@@ -864,7 +864,7 @@ void FileRenamer::rename(const PlaylistItemList &items)
if(itemMap.isEmpty() || ConfirmationDialog(map).exec() != TQDialog::Accepted)
return;
- KApplication::setOverrideCursor(Qt::waitCursor);
+ KApplication::setOverrideCursor(TQt::waitCursor);
for(TQMap<TQString, TQString>::ConstIterator it = map.begin();
it != map.end(); ++it)
{
@@ -875,7 +875,7 @@ void FileRenamer::rename(const PlaylistItemList &items)
setFolderIcon(it.data(), itemMap[it.key()]);
}
else
- errorFiles << i18n("%1 to %2").arg(it.key()).arg(it.data());
+ errorFiles << i18n("%1 to %2").tqarg(it.key()).tqarg(it.data());
processEvents();
}
@@ -906,7 +906,7 @@ bool FileRenamer::moveFile(const TQString &src, const TQString &dest)
// Get just the directory.
KURL dir = dstURL;
- dir.setFileName(TQString::null);
+ dir.setFileName(TQString());
// Create the directory.
if(!KStandardDirs::exists(dir.path()))
@@ -939,7 +939,7 @@ void FileRenamer::setFolderIcon(const KURL &dst, const PlaylistItem *item)
path.append("/" + (*it));
kdDebug() << "Checking path: " << path << endl;
- if((*it).find(item->file().tag()->album()) != -1 &&
+ if((*it).tqfind(item->file().tag()->album()) != -1 &&
!TQFile::exists(path + "/.directory"))
{
// Seems to be a match, let's set the folder icon for the current
@@ -952,7 +952,7 @@ void FileRenamer::setFolderIcon(const KURL &dst, const PlaylistItem *item)
config.setGroup("Desktop Entry");
if(!config.hasKey("Icon")) {
- config.writeEntry("Icon", TQString("%1/.juk-thumbnail.png").arg(path));
+ config.writeEntry("Icon", TQString("%1/.juk-thumbnail.png").tqarg(path));
config.sync();
}
@@ -1011,7 +1011,7 @@ TQString FileRenamer::fileName(const CategoryReaderInterface &interface)
// 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
// back out when showing it in the GUI?
- value.replace('/', "%2f");
+ value.tqreplace('/', "%2f");
if(!pastLast && interface.hasFolderSeparator(i))
value.append(dirSeparator);