From 640818471db81c12a2e4ce01ebab4ec7de884ff5 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 2 May 2006 21:03:58 +0000 Subject: [PATCH] deprecated svn path=/trunk/KDE/kdemultimedia/juk/; revision=536733 --- artsplayer.h | 2 +- filerenamer.cpp | 4 ++-- gstreamerplayer.h | 2 +- ktrm.h | 2 +- playermanager.cpp | 10 +++++----- playlistcollection.cpp | 2 +- playlistitem.cpp | 6 +++--- playlistsearch.cpp | 6 +++--- searchwidget.cpp | 6 ++++-- slideraction.cpp | 2 +- tag.cpp | 4 ++-- tageditor.cpp | 12 ++++++++---- tagguesser.cpp | 10 +++++----- viewmode.cpp | 4 ++-- 14 files changed, 39 insertions(+), 33 deletions(-) diff --git a/artsplayer.h b/artsplayer.h index b9a681bb..039ba6df 100644 --- a/artsplayer.h +++ b/artsplayer.h @@ -21,7 +21,7 @@ #include -#if HAVE_ARTS +#ifdef HAVE_ARTS #include "player.h" diff --git a/filerenamer.cpp b/filerenamer.cpp index 5da12f70..82201541 100644 --- a/filerenamer.cpp +++ b/filerenamer.cpp @@ -274,7 +274,7 @@ void FileRenamerWidget::loadConfig() checkedSeparators = config.readEntry("CheckedDirSeparators", QList()); - + for(QList::ConstIterator it = checkedSeparators.begin(); it != checkedSeparators.end(); ++it) { @@ -947,7 +947,7 @@ void FileRenamer::setFolderIcon(const KUrl &dst, const PlaylistItem *item) path.append("/" + (*it)); kDebug() << "Checking path: " << path << endl; - if((*it).find(item->file().tag()->album()) != -1 && + if((*it).contains(item->file().tag()->album() ) && !QFile::exists(path + "/.directory")) { // Seems to be a match, let's set the folder icon for the current diff --git a/gstreamerplayer.h b/gstreamerplayer.h index a2ed2551..1c1a1a5f 100644 --- a/gstreamerplayer.h +++ b/gstreamerplayer.h @@ -18,7 +18,7 @@ #include "config.h" -#if HAVE_GSTREAMER +#ifdef HAVE_GSTREAMER #include #include diff --git a/ktrm.h b/ktrm.h index f5f8f3b6..0b83dbab 100644 --- a/ktrm.h +++ b/ktrm.h @@ -29,7 +29,7 @@ #include -#if HAVE_TUNEPIMP +#ifdef HAVE_TUNEPIMP #include #include diff --git a/playermanager.cpp b/playermanager.cpp index 1e4bef8e..d46bfc65 100644 --- a/playermanager.cpp +++ b/playermanager.cpp @@ -66,18 +66,18 @@ static Player *createPlayer(int system = ArtsBackend) p = new aKodePlayer; break; #endif -#if HAVE_ARTS +#ifdef HAVE_ARTS case ArtsBackend: p = new ArtsPlayer; break; #endif -#if HAVE_GSTREAMER +#ifdef HAVE_GSTREAMER case GStreamerBackend: p = new GStreamerPlayer; break; #endif default: -#if HAVE_ARTS +#ifdef HAVE_ARTS p = new ArtsPlayer; #elif HAVE_GSTREAMER p = new GStreamerPlayer; @@ -247,10 +247,10 @@ KSelectAction *PlayerManager::playerSelectAction() // static new KSelectAction(i18n("&Output To"), ActionCollection::actions(), "outputSelect"); QStringList l; -#if HAVE_ARTS +#ifdef HAVE_ARTS l.append(i18n("aRts")); #endif -#if HAVE_GSTREAMER +#ifdef HAVE_GSTREAMER l.append(i18n("GStreamer")); #endif #ifdef HAVE_AKODE diff --git a/playlistcollection.cpp b/playlistcollection.cpp index 1328bc54..a9c03279 100644 --- a/playlistcollection.cpp +++ b/playlistcollection.cpp @@ -509,7 +509,7 @@ void PlaylistCollection::createFolderPlaylist() if(folder.isEmpty()) return; - QString name = uniquePlaylistName(folder.mid(folder.findRev('/') + 1)); + QString name = uniquePlaylistName(folder.mid(folder.lastIndexOf('/') + 1)); name = playlistNameDialog(i18n("Create Folder Playlist"), name); if(!name.isNull()) diff --git a/playlistitem.cpp b/playlistitem.cpp index 3e5038c1..9ce5b8ed 100644 --- a/playlistitem.cpp +++ b/playlistitem.cpp @@ -275,10 +275,10 @@ void PlaylistItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int if(!m_playingItems.contains(this)) return K3ListViewItem::paintCell(p, cg, column, width, align); - QColorGroup colorGroup = cg; + QPalette colorGroup = cg; - QColor base = colorGroup.base(); - QColor selection = colorGroup.highlight(); + QColor base = colorGroup.color( QPalette::Base ); + QColor selection = colorGroup.color( QPalette::Highlight ); int r = (base.red() + selection.red()) / 2; int b = (base.blue() + selection.blue()) / 2; diff --git a/playlistsearch.cpp b/playlistsearch.cpp index bcf55e86..1e7483db 100644 --- a/playlistsearch.cpp +++ b/playlistsearch.cpp @@ -197,7 +197,7 @@ bool PlaylistSearch::Component::matches(PlaylistItem *item) const for(ColumnList::Iterator it = m_columns.begin(); it != m_columns.end(); ++it) { if(m_re) { - if(item->text(*it).find(m_queryRe) > -1) + if(item->text(*it).contains(m_queryRe)) return true; else break; @@ -205,7 +205,7 @@ bool PlaylistSearch::Component::matches(PlaylistItem *item) const switch(m_mode) { case Contains: - if(item->text(*it).find(m_query, 0, m_caseSensitive) > -1) + if(item->text(*it).contains(m_query, m_caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive)) return true; break; case Exact: @@ -221,7 +221,7 @@ bool PlaylistSearch::Component::matches(PlaylistItem *item) const case ContainsWord: { QString s = item->text(*it); - int i = s.find(m_query, 0, m_caseSensitive); + int i = s.indexOf(m_query, 0, m_caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); if(i >= 0) { diff --git a/searchwidget.cpp b/searchwidget.cpp index 3f2ea329..21571c33 100644 --- a/searchwidget.cpp +++ b/searchwidget.cpp @@ -273,9 +273,11 @@ void SearchWidget::setupLayout() clearSearchButton->setTextLabel(i18n("Clear Search"), true); clearSearchButton->setIconSet(SmallIconSet("locationbar_erase")); - QLabel *label = new QLabel(i18n("Search:"), this, "kde toolbar widget"); + QLabel *label = new QLabel(i18n("Search:"), this ); + label->setObjectName( "kde toolbar widget" ); - m_searchLine = new SearchLine(this, true, "kde toolbar widget"); + m_searchLine = new SearchLine(this, true ); + m_searchLine->setObjectName( "kde toolbar widget" ); label->setBuddy(m_searchLine); diff --git a/slideraction.cpp b/slideraction.cpp index fc6535d6..291e9f9e 100644 --- a/slideraction.cpp +++ b/slideraction.cpp @@ -223,7 +223,7 @@ QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base { if(parent) { QWidget *base = new QWidget(parent); - base->setBackgroundMode(parent->backgroundMode()); + base->setBackgroundRole(parent->backgroundRole()); base->setName("kde toolbar widget"); KToolBar *toolBar = dynamic_cast(parent); diff --git a/tag.cpp b/tag.cpp index 65388051..9fc33071 100644 --- a/tag.cpp +++ b/tag.cpp @@ -245,8 +245,8 @@ void Tag::setup(TagLib::File *file) m_lengthString = QString::number(minutes) + (seconds >= 10 ? ":" : ":0") + QString::number(seconds); if(m_title.isEmpty()) { - int i = m_fileName.findRev('/'); - int j = m_fileName.findRev('.'); + int i = m_fileName.lastIndexOf('/'); + int j = m_fileName.lastIndexOf('.'); m_title = i > 0 ? m_fileName.mid(i + 1, j - i - 1) : m_fileName; } diff --git a/tageditor.cpp b/tageditor.cpp index d7c57967..fdd71c93 100644 --- a/tageditor.cpp +++ b/tageditor.cpp @@ -67,7 +67,7 @@ public: virtual State validate(QString &s, int &) const { - if(s.find('/') != -1) + if(s.contains('/')) return Invalid; return Acceptable; } @@ -546,7 +546,9 @@ void TagEditor::setupLayout() QLabel *fileNameIcon = new QLabel(this); fileNameIcon->setPixmap(SmallIcon("sound")); - QWidget *fileNameLabel = addHidden(new QLabel(m_fileNameBox, i18n("&File name:"), this)); + QLabel * tmp = new QLabel(i18n("&File name:"), this); + tmp->setBuddy( m_fileNameBox ); + QWidget *fileNameLabel = addHidden(tmp); fileNameLayout->addWidget(addHidden(fileNameIcon)); fileNameLayout->addWidget(fileNameLabel); @@ -739,8 +741,10 @@ void TagEditor::addItem(const QString &text, QWidget *item, QBoxLayout *layout, if(!item || !layout) return; - QLabel *label = new QLabel(item, text, this); - QLabel *iconLabel = new QLabel(item, 0, this); + QLabel *label = new QLabel(text, this); + label->setBuddy( item ); + QLabel *iconLabel = new QLabel(0, this); + iconLabel->setBuddy( item ); if(!iconName.isNull()) iconLabel->setPixmap(SmallIcon(iconName)); diff --git a/tagguesser.cpp b/tagguesser.cpp index 3f48c915..e87e838d 100644 --- a/tagguesser.cpp +++ b/tagguesser.cpp @@ -24,7 +24,7 @@ FileNameScheme::FileNameScheme(const QString &s) m_commentField(-1) { int fieldNumber = 1; - int i = s.find('%'); + int i = s.indexOf('%'); while (i > -1) { switch (s[ i + 1 ].toLatin1()) { case 't': m_titleField = fieldNumber++; @@ -40,7 +40,7 @@ FileNameScheme::FileNameScheme(const QString &s) default: break; } - i = s.find('%', i + 1); + i = s.indexOf('%', i + 1); } m_regExp.setPattern(composeRegExp(s)); } @@ -51,7 +51,7 @@ bool FileNameScheme::matches(const QString &fileName) const * does not work as a separator. */ QString stripped = fileName; - stripped.truncate(stripped.findRev('.')); + stripped.truncate(stripped.lastIndexOf('.')); return m_regExp.exactMatch(stripped); } @@ -205,10 +205,10 @@ QString TagGuesser::capitalizeWords(const QString &s) result[ 0 ] = result[ 0 ].upper(); const QRegExp wordRegExp("\\s\\w"); - int i = result.find( wordRegExp ); + int i = result.indexOf( wordRegExp ); while ( i > -1 ) { result[ i + 1 ] = result[ i + 1 ].upper(); - i = result.find( wordRegExp, ++i ); + i = result.indexOf( wordRegExp, ++i ); } return result; diff --git a/viewmode.cpp b/viewmode.cpp index 1ef1842e..3308097c 100644 --- a/viewmode.cpp +++ b/viewmode.cpp @@ -84,7 +84,7 @@ void ViewMode::paintCell(PlaylistBox::Item *item, painter->fillRect(border, border, width - border * 2, item->height() - border * 2 + 1, colorGroup.brush(QPalette::Highlight)); - painter->setPen(colorGroup.highlightedText()); + painter->setPen(colorGroup.color( QPalette::HighlightedText)); } else painter->eraseRect(0, 0, width, item->height()); @@ -199,7 +199,7 @@ QStringList ViewMode::lines(const PlaylistBox::Item *item, fm.width(line.mid(0, textLength).stripWhiteSpace()) + item->listView()->itemMargin() * 2 > width) { - int i = line.findRev(QRegExp( "\\W"), textLength - 1); + int i = line.lastIndexOf(QRegExp( "\\W"), textLength - 1); if(i > 0) textLength = i; else -- GitLab