Commit 3f8260c7 authored by Dirk Mueller's avatar Dirk Mueller

qt3support--

svn path=/trunk/KDE/kdemultimedia/juk/; revision=584892
parent 827240bf
......@@ -367,7 +367,7 @@ void CollectionListItem::refresh()
if(id != TrackNumberColumn && id != LengthColumn) {
// All columns other than track num and length need local-encoded data for sorting
QByteArray lower = text(i).lower().local8Bit();
QByteArray toLower = text(i).toLower().local8Bit();
// For some columns, we may be able to share some strings
......@@ -375,15 +375,15 @@ void CollectionListItem::refresh()
(id == GenreColumn) || (id == YearColumn) ||
(id == CommentColumn))
{
lower = StringShare::tryShare(lower);
toLower = StringShare::tryShare(toLower);
if(id != YearColumn && id != CommentColumn && data()->local8Bit[id] != lower) {
if(id != YearColumn && id != CommentColumn && data()->local8Bit[id] != toLower) {
CollectionList::instance()->removeStringFromDict(data()->local8Bit[id], id);
CollectionList::instance()->addStringToDict(text(i), id);
}
}
data()->local8Bit[id] = lower;
data()->local8Bit[id] = toLower;
}
int newWidth = width(listView()->fontMetrics(), listView(), i);
......
......@@ -58,7 +58,7 @@ public:
int compare(Q3ListViewItem *item, int column, bool ascending) const
{
Q_UNUSED(ascending);
return text(column).lower().localeAwareCompare(item->text(column).lower());
return text(column).toLower().localeAwareCompare(item->text(column).toLower());
}
};
......@@ -123,7 +123,7 @@ void CoverDialog::slotArtistClicked(Q3ListViewItem *item)
loadCovers();
}
else {
QString artist = item->text(0).lower();
QString artist = item->text(0).toLower();
Q3ValueList<coverKey> keys = CoverManager::keys();
Q3ValueList<coverKey>::ConstIterator it;
......
......@@ -39,7 +39,7 @@
struct CoverPopup : public QWidget
{
CoverPopup(const QPixmap &image, const QPoint &p) :
QWidget(0, 0, Qt::WDestructiveClose | Qt::WX11BypassWM)
QWidget(0, Qt::WDestructiveClose | Qt::WX11BypassWM)
{
QHBoxLayout *layout = new QHBoxLayout(this);
QLabel *label = new QLabel(this);
......@@ -246,7 +246,7 @@ QString CoverInfo::coverLocation(CoverSize size) const
default:
break;
}
QString fileLocation = dataDir + "covers/" + subDir + fileName.lower();
QString fileLocation = dataDir + "covers/" + subDir + fileName.toLower();
return fileLocation;
}
......
......@@ -325,7 +325,7 @@ coverKey CoverManager::idFromMetadata(const QString &artist, const QString &albu
CoverDataMap::ConstIterator endIt = end();
for(; it != endIt; ++it) {
if(it.data()->album == album.lower() && it.data()->artist == artist.lower())
if(it.data()->album == album.toLower() && it.data()->artist == artist.toLower())
return it.key();
}
......@@ -408,8 +408,8 @@ coverKey CoverManager::addCover(const QPixmap &large, const QString &artist, con
return NoMatch;
}
coverData->artist = artist.lower();
coverData->album = album.lower();
coverData->artist = artist.toLower();
coverData->album = album.toLower();
coverData->refCount = 0;
data()->covers[id] = coverData;
......
......@@ -244,7 +244,7 @@ QStringList FileHandle::properties() // static
QString FileHandle::property(const QString &name) const
{
return FileHandleProperties::property(*this, name.latin1());
return FileHandleProperties::property(*this, name.toAscii());
}
const FileHandle &FileHandle::null() // static
......
......@@ -41,7 +41,7 @@ GoogleFetcherDialog::GoogleFetcherDialog(const QString &name,
m_newSearch(false),
m_file(file)
{
setObjectName(name.latin1());
setObjectName(name.toAscii());
setModal(true);
setCaption(QString::null);
setButtons(Ok | Cancel | User1);
......
......@@ -182,7 +182,7 @@ protected:
QString proxyHost = proxy.host();
kDebug(65432) << "Using proxy server " << proxyHost << " for www.musicbrainz.org.\n";
tp_SetProxy(m_pimp, proxyHost.latin1(), short(proxy.port()));
tp_SetProxy(m_pimp, proxyHost.toAscii(), short(proxy.port()));
}
}
}
......
......@@ -225,9 +225,10 @@ void CoverItem::dropEvent(QDropEvent *e)
////////////////////////////////////////////////////////////////////////////////
TrackItem::TrackItem(NowPlaying *parent) :
QWidget(parent, "TrackItem"),
QWidget(parent),
NowPlayingItem(parent)
{
setObjectName("TrackItem");
setFixedHeight(parent->height() - parent->layout()->margin() * 2);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
......
......@@ -1208,7 +1208,7 @@ void Playlist::contentsDropEvent(QDropEvent *e)
return;
}
// When dropping on the upper half of an item, insert before this item.
// When dropping on the toUpper half of an item, insert before this item.
// This is what the user expects, and also allows the insertion at
// top of the list
......@@ -1856,7 +1856,7 @@ void Playlist::addFile(const QString &file, FileHandleList &files, bool importPl
// We set importPlaylists to the value from the add directories
// dialog as we want to load all of the ones that the user has
// explicitly asked for, but not those that we find in lower
// explicitly asked for, but not those that we find in toLower
// directories.
addFile(fileInfo.filePath() + QDir::separator() + QFile::decodeName(dirEntry->d_name),
......@@ -1958,7 +1958,7 @@ void Playlist::slotUpdateColumnWidths()
// Make sure that the width won't get any smaller than this. We have to
// account for the scrollbar as well. Since this method is called from the
// resize event this will set a pretty hard lower bound on the size.
// resize event this will set a pretty hard toLower bound on the size.
setMinimumWidth(minimumWidthTotal + verticalScrollBar()->width());
......
......@@ -734,7 +734,7 @@ int PlaylistBox::Item::compare(Q3ListViewItem *i, int col, bool) const
else if(otherItem->m_sortedFirst && !m_sortedFirst)
return 1;
return text(col).lower().localeAwareCompare(i->text(col).lower());
return text(col).toLower().localeAwareCompare(i->text(col).toLower());
}
void PlaylistBox::Item::paintCell(QPainter *painter, const QColorGroup &colorGroup, int column, int width, int align)
......
......@@ -335,8 +335,8 @@ int PlaylistItem::compare(const PlaylistItem *firstItem, const PlaylistItem *sec
return 0;
if(column < offset) {
QString first = firstItem->text(column).lower();
QString second = secondItem->text(column).lower();
QString first = firstItem->text(column).toLower();
QString second = secondItem->text(column).toLower();
return first.localeAwareCompare(second);
}
......
......@@ -213,7 +213,7 @@ bool PlaylistSearch::Component::matches(PlaylistItem *item) const
if(item->text(*it) == m_query)
return true;
}
else if(item->text(*it).lower() == m_query.lower())
else if(item->text(*it).toLower() == m_query.toLower())
return true;
}
break;
......
......@@ -147,7 +147,8 @@ void PlaylistSplitter::setupLayout()
connect(m_playlistStack, SIGNAL(aboutToShow(QWidget *)), this, SLOT(slotPlaylistChanged(QWidget *)));
m_editor = new TagEditor(editorSplitter, "tagEditor");
m_editor = new TagEditor(editorSplitter);
m_editor->setObjectName("TagEditor");
// Make the editor as small as possible (or at least as small as recommended)
......
......@@ -32,7 +32,7 @@ int SplashScreen::count = 0;
static QString loadedText(int i)
{
static QString loading = i18n("Loading").upper();
static QString loading = i18n("Loading").toUpper();
return loading + ": " + QString::number(i);;
}
......
......@@ -148,8 +148,8 @@ private:
// public members
////////////////////////////////////////////////////////////////////////////////
TagEditor::TagEditor(QWidget *parent, const char *name) :
QWidget(parent, name),
TagEditor::TagEditor(QWidget *parent) :
QWidget(parent),
m_currentPlaylist(0),
m_observer(0),
m_performingSave(false)
......@@ -492,7 +492,7 @@ void TagEditor::saveConfig()
void TagEditor::setupActions()
{
KToggleAction *show = new KToggleAction(KIcon("edit"), i18n("Show &Tag Editor"), ActionCollection::actions(), "showEditor");
show->setCheckedState(i18n("Hide &Tag Editor"));
show->setCheckedState(KGuiItem(i18n("Hide &Tag Editor")));
connect(show, SIGNAL(toggled(bool)), this, SLOT(setShown(bool)));
KAction *act = new KAction(KIcon("filesave"), i18n("&Save"), ActionCollection::actions(), "saveItem");
......@@ -699,26 +699,26 @@ void TagEditor::save(const PlaylistItemList &list)
// files. We have to check to see if that is enabled before
// each field that we write.
if(m_enableBoxes[m_artistNameBox]->isOn())
if(m_enableBoxes[m_artistNameBox]->isChecked())
tag->setArtist(m_artistNameBox->currentText());
if(m_enableBoxes[m_trackNameBox]->isOn())
if(m_enableBoxes[m_trackNameBox]->isChecked())
tag->setTitle(m_trackNameBox->text());
if(m_enableBoxes[m_albumNameBox]->isOn())
if(m_enableBoxes[m_albumNameBox]->isChecked())
tag->setAlbum(m_albumNameBox->currentText());
if(m_enableBoxes[m_trackSpin]->isOn()) {
if(m_enableBoxes[m_trackSpin]->isChecked()) {
if(m_trackSpin->text().isEmpty())
m_trackSpin->setValue(0);
tag->setTrack(m_trackSpin->value());
}
if(m_enableBoxes[m_yearSpin]->isOn()) {
if(m_enableBoxes[m_yearSpin]->isChecked()) {
if(m_yearSpin->text().isEmpty())
m_yearSpin->setValue(0);
tag->setYear(m_yearSpin->value());
}
if(m_enableBoxes[m_commentBox]->isOn())
if(m_enableBoxes[m_commentBox]->isChecked())
tag->setComment(m_commentBox->toPlainText());
if(m_enableBoxes[m_genreBox]->isOn())
if(m_enableBoxes[m_genreBox]->isChecked())
tag->setGenre(m_genreBox->currentText());
TagTransactionManager::instance()->changeTagOnItem(item, tag);
......
......@@ -44,7 +44,7 @@ class TagEditor : public QWidget
Q_OBJECT
public:
TagEditor(QWidget *parent = 0, const char *name = 0);
TagEditor(QWidget *parent = 0);
virtual ~TagEditor();
PlaylistItemList items() const { return m_items; }
void setupObservers();
......
......@@ -202,12 +202,12 @@ QString TagGuesser::capitalizeWords(const QString &s)
return s;
QString result = s;
result[ 0 ] = result[ 0 ].upper();
result[ 0 ] = result[ 0 ].toUpper();
const QRegExp wordRegExp("\\s\\w");
int i = result.indexOf( wordRegExp );
while ( i > -1 ) {
result[ i + 1 ] = result[ i + 1 ].upper();
result[ i + 1 ] = result[ i + 1 ].toUpper();
i = result.indexOf( wordRegExp, ++i );
}
......
......@@ -37,26 +37,31 @@ void check( const QString &filename, const QString &title,
const QString &artist, const QString &track,
const QString &comment, const QString &album = QString::null )
{
cout << "Checking " << filename.latin1() << "...";
cout << "Checking " << qPrintable(filename) << "...";
TagGuesser guesser( filename );
if ( guesser.title() != title ) {
cout << "Error: In filename " << filename.latin1() << ", expected title " << title.latin1() << ", got title " << guesser.title().latin1() << endl;
cout << "Error: In filename " << qPrintable(filename) << ", expected title " <<
qPrintable(title) << ", got title " << qPrintable(guesser.title()) << endl;
exit( 1 );
}
if ( guesser.artist() != artist ) {
cout << "Error: In filename " << filename.latin1() << ", expected artist " << artist.latin1() << ", got artist " << guesser.artist().latin1() << endl;
cout << "Error: In filename " << qPrintable(filename) << ", expected artist " <<
qPrintable(artist) << ", got artist " << qPrintable(guesser.artist()) << endl;
exit( 1 );
}
if ( guesser.track() != track ) {
cout << "Error: In filename " << filename.latin1() << ", expected track " << track.latin1() << ", got track " << guesser.track().latin1() << endl;
cout << "Error: In filename " << qPrintable(filename) << ", expected track " <<
qPrintable(track) << ", got track " << qPrintable(guesser.track()) << endl;
exit( 1 );
}
if ( guesser.comment() != comment ) {
cout << "Error: In filename " << filename.latin1() << ", expected comment " << comment.latin1() << ", got comment " << guesser.comment().latin1() << endl;
cout << "Error: In filename " << qPrintable(filename) << ", expected comment " <<
qPrintable(comment) << ", got comment " << qPrintable(guesser.comment()) << endl;
exit( 1 );
}
if ( guesser.album() != album ) {
cout << "Error: In filename " << filename.latin1() << ", expected album " << album.latin1() << ", got album " << guesser.album().latin1() << endl;
cout << "Error: In filename " << qPrintable(filename) << ", expected album " <<
qPrintable(album) << ", got album " << qPrintable(guesser.album()) << endl;
exit( 1 );
}
cout << "OK" << endl;
......
......@@ -72,7 +72,7 @@ TagRenamerOptions::TagRenamerOptions(const CategoryID &category)
// Default the emptyAction to ignoring the empty tag.
const QString emptyAction = config.readEntry(QString("%1EmptyAction").arg(typeKey), QString()).lower();
const QString emptyAction = config.readEntry(QString("%1EmptyAction").arg(typeKey), QString()).toLower();
setEmptyAction(IgnoreEmptyTag);
if(emptyAction == "forceemptyinclude")
......
......@@ -50,7 +50,7 @@ TrackPickerDialog::TrackPickerDialog(const QString &name,
QWidget *parent) :
KDialog(parent)
{
setObjectName(name.latin1());
setObjectName(name.toAscii());
setModal(true);
setCaption(i18n("Internet Tag Guesser"));
setButtons(Ok | Cancel);
......
......@@ -184,7 +184,7 @@ QStringList ViewMode::lines(const PlaylistBox::Item *item,
int width)
{
// Here 32 is a bit arbitrary, but that's the width of the icons in this
// mode and seems to a reasonable lower bound.
// mode and seems to a reasonable toLower bound.
if(width < 32)
return QStringList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment