diff --git a/artsplayer.h b/artsplayer.h index b9a681bb15e09c8759aab93f2a5cd38fc30c8d44..039ba6df3c41cc7f126c3f585a77fe5d2b49c34d 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 5da12f707a1c4a973b7e3bb19872acc69b8dcdc5..822015414c193c5ecb8dac92c037d4774bf8e0e1 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 a2ed2551f3a33b18515bde0c97eaa6a1ea86ab04..1c1a1a5f19ab4edd28019f6dd6cb458edee4dcb0 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 f5f8f3b6f740e75a9d7bf700d2c06bf6b4d2e7e2..0b83dbabb599d0b909a20f592c19dba2104d555f 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 1e4bef8e9e7a03f0dce32feca82259bdf70ffd6d..d46bfc65d482f9a63af6f67ea355ded2b7182408 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 1328bc5432147df633062971f8dd3135663d7dc4..a9c03279fddb8d7fb084b2a74d4e23681afbc3ab 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 3e5038c1261aa31ccaaf8c12a902985ee81761db..9ce5b8edc35ec8e43a10753212c155abeac6f4f7 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 bcf55e8628b1ca0cb6a9ef346677ba9b3f5754bc..1e7483db02e0702b445578fc878bc1c96e897dd9 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 3f2ea32900e47fa6efaa6a95403f91bad6deee22..21571c334b265f969e889290045c4a324191fd85 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 fc6535d60d8eb5dd68d702638fc94183eb3d67f1..291e9f9e91926c96b5d09574fb84cc14e3a58c46 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 65388051746da9e4c7fd5c8b8cab1914c86848e4..9fc33071f2e860178a2bec703580921a3db1b77b 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 d7c5796744605835a980ec718c523f4a4b0116e0..fdd71c93b6140ec832644699982974c89e0d5de7 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 3f48c915cad69e337c0aaa421717f77866bf2dbc..e87e838d0b834e3a290239a6cbb466828e735ede 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 1ef1842eeb9969310a9ff022dc542a36b46f6759..3308097c85afa0ac935803f54b279de6d6ac1d00 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