From: Zack Rusin Date: Mon, 4 Dec 2006 05:46:34 +0000 (+0000) Subject: reducing a little bit the number of deprecation warnings X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/01f577fda1b2ee522a0e87edab7c079c8b553860 reducing a little bit the number of deprecation warnings svn path=/trunk/playground/utils/dolphin/; revision=610300 --- diff --git a/src/bookmarkselector.cpp b/src/bookmarkselector.cpp index 7b489b8fa..a22eeb17a 100644 --- a/src/bookmarkselector.cpp +++ b/src/bookmarkselector.cpp @@ -51,7 +51,8 @@ BookmarkSelector::BookmarkSelector(UrlNavigator* parent) : i); if (i == m_selectedIndex) { QPixmap pixmap = SmallIcon(bookmark.icon()); - setPixmap(pixmap); + setIcon(QIcon(pixmap)); + setIconSize(pixmap.size()); setMinimumWidth(pixmap.width() + 2); } bookmark = root.next(bookmark); @@ -61,7 +62,7 @@ BookmarkSelector::BookmarkSelector(UrlNavigator* parent) : connect(m_bookmarksMenu, SIGNAL(activated(int)), this, SLOT(slotBookmarkActivated(int))); - setPopup(m_bookmarksMenu); + setMenu(m_bookmarksMenu); } BookmarkSelector::~BookmarkSelector() @@ -86,7 +87,7 @@ void BookmarkSelector::updateSelection(const KUrl& url) const int length = bookmarkUrl.prettyUrl().length(); if (length > maxLength) { m_selectedIndex = i; - setPixmap(SmallIcon(bookmark.icon())); + setIcon(SmallIcon(bookmark.icon())); maxLength = length; } } @@ -97,7 +98,7 @@ void BookmarkSelector::updateSelection(const KUrl& url) if (m_selectedIndex < 0) { // No bookmark has been found which matches to the given Url. Show // a generic folder icon as pixmap for indication: - setPixmap(SmallIcon("folder")); + setIcon(SmallIcon("folder")); } } @@ -128,7 +129,7 @@ void BookmarkSelector::paintEvent(QPaintEvent* event) foregroundColor = KGlobalSettings::highlightedTextColor(); } else { - backgroundColor = colorGroup().background(); + backgroundColor = palette().brush(QPalette::Background).color(); foregroundColor = KGlobalSettings::buttonTextColor(); } @@ -138,7 +139,7 @@ void BookmarkSelector::paintEvent(QPaintEvent* event) const bool isActive = (dolphin->activeView() == parentView); if (!isActive) { - QColor dimmColor(colorGroup().background()); + QColor dimmColor(palette().brush(QPalette::Background).color()); foregroundColor = mixColors(foregroundColor, dimmColor); if (isHighlighted) { backgroundColor = mixColors(backgroundColor, dimmColor); diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp index a27a4cb27..cad182d6a 100644 --- a/src/dolphinapplication.cpp +++ b/src/dolphinapplication.cpp @@ -50,7 +50,7 @@ DolphinMainWindow* DolphinApplication::createMainWindow() void DolphinApplication::removeMainWindow( DolphinMainWindow *mainwindow ) { - m_mainWindows.remove( mainwindow ); + m_mainWindows.removeAll( mainwindow ); } void DolphinApplication::refreshMainWindows() diff --git a/src/dolphinstatusbar.cpp b/src/dolphinstatusbar.cpp index 7f5a73fea..6d7df4511 100644 --- a/src/dolphinstatusbar.cpp +++ b/src/dolphinstatusbar.cpp @@ -116,7 +116,8 @@ void DolphinStatusBar::setProgress(int percent) m_progress = percent; m_progressBar->setValue(m_progress); - m_progressTimer->start(300, true); + m_progressTimer->setSingleShot(true); + m_progressTimer->start(300); const QString msg(m_messageLabel->text()); if (msg.isEmpty() || (msg == m_defaultText)) { diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 6a9a68ddf..bc4d9144d 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -68,7 +68,7 @@ DolphinView::DolphinView(DolphinMainWindow *mainWindow, m_filterBar(0) { setFocusPolicy(Qt::StrongFocus); - m_topLayout = new Q3VBoxLayout(this); + m_topLayout = new QVBoxLayout(this); connect(this, SIGNAL(signalModeChanged()), mainWindow, SLOT(slotViewModeChanged())); @@ -242,7 +242,7 @@ void DolphinView::renameSelectedItems() urlsCount); // iterate through all selected items and rename them... - const int replaceIndex = newName.find('#'); + const int replaceIndex = newName.indexOf('#'); assert(replaceIndex >= 0); for (int i = 0; i < urlsCount; ++i) { const KUrl& source = urls[i]; diff --git a/src/dolphinview.h b/src/dolphinview.h index 423159952..23ff2eea7 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -458,7 +458,7 @@ private: bool m_showProgress; Mode m_mode; - Q3VBoxLayout* m_topLayout; + QVBoxLayout* m_topLayout; UrlNavigator* m_urlNavigator; DolphinIconsView* m_iconsView; DolphinStatusBar* m_statusBar; diff --git a/src/urlnavigator.cpp b/src/urlnavigator.cpp index bc2c5914e..6ab73976a 100644 --- a/src/urlnavigator.cpp +++ b/src/urlnavigator.cpp @@ -301,7 +301,7 @@ void UrlNavigator::slotReturnPressed(const QString& text) } QStringList urls = m_pathBox->urls(); - urls.remove(typedUrl.url()); + urls.removeAll(typedUrl.url()); urls.prepend(typedUrl.url()); m_pathBox->setUrls(urls, KUrlComboBox::RemoveBottom); @@ -323,7 +323,7 @@ void UrlNavigator::slotRemoteHostActivated() QString host = m_host->text(); QString user; - int marker = host.find("@"); + int marker = host.indexOf("@"); if (marker != -1) { user = host.left(marker); @@ -331,7 +331,7 @@ void UrlNavigator::slotRemoteHostActivated() host = host.right(host.length() - marker - 1); } - marker = host.find("/"); + marker = host.indexOf("/"); if (marker != -1) { u.setPath(host.right(host.length() - marker)); @@ -468,7 +468,7 @@ void UrlNavigator::updateContent() m_bookmarkSelector->updateSelection(url()); - QToolTip::remove(m_toggleButton); + m_toggleButton->setToolTip(QString()); QString path(url().pathOrUrl()); const KAction* action = dolphinView()->mainWindow()->actionCollection()->action("editable_location"); // TODO: registry of default shortcuts @@ -478,14 +478,14 @@ void UrlNavigator::updateContent() delete m_protocolSeparator; m_protocolSeparator = 0; delete m_host; m_host = 0; - QToolTip::add(m_toggleButton, i18n("Browse (%1, Escape)",shortcut)); + m_toggleButton->setToolTip(i18n("Browse (%1, Escape)",shortcut)); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); m_pathBox->show(); m_pathBox->setUrl(url()); } else { - QToolTip::add(m_toggleButton, i18n("Edit location (%1)",shortcut)); + m_toggleButton->setToolTip(i18n("Edit location (%1)",shortcut)); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_pathBox->hide(); @@ -502,8 +502,8 @@ void UrlNavigator::updateContent() // path. E. g. "fish://root@192.168.0.2/var/lib" writes // "fish://root@192.168.0.2" to 'bookmarkPath', which leads to the // navigation indication 'Custom Path > var > lib". - int idx = path.find(QString("//")); - idx = path.find("/", (idx < 0) ? 0 : idx + 2); + int idx = path.indexOf(QString("//")); + idx = path.indexOf("/", (idx < 0) ? 0 : idx + 2); bookmarkPath = (idx < 0) ? path : path.left(idx); } else { diff --git a/src/urlnavigatorbutton.cpp b/src/urlnavigatorbutton.cpp index 5e800c1a2..eb372f558 100644 --- a/src/urlnavigatorbutton.cpp +++ b/src/urlnavigatorbutton.cpp @@ -98,6 +98,7 @@ QSize UrlNavigatorButton::sizeHint() const void UrlNavigatorButton::paintEvent(QPaintEvent* event) { QPainter painter(this); + painter.setClipRect(event->rect()); const int buttonWidth = width(); const int buttonHeight = height(); @@ -111,7 +112,7 @@ void UrlNavigatorButton::paintEvent(QPaintEvent* event) foregroundColor = KGlobalSettings::highlightedTextColor(); } else { - backgroundColor = colorGroup().background(); + backgroundColor = palette().brush(QPalette::Background).color(); foregroundColor = KGlobalSettings::buttonTextColor(); } @@ -121,7 +122,7 @@ void UrlNavigatorButton::paintEvent(QPaintEvent* event) const bool isActive = (dolphin->activeView() == parentView); if (!isActive) { - QColor dimmColor(colorGroup().background()); + QColor dimmColor(palette().brush(QPalette::Background).color()); foregroundColor = mixColors(foregroundColor, dimmColor); if (isHighlighted) { backgroundColor = mixColors(backgroundColor, dimmColor); @@ -192,14 +193,14 @@ void UrlNavigatorButton::enterEvent(QEvent* event) // if the text is clipped due to a small window width, the text should // be shown as tooltip if (isTextClipped()) { - QToolTip::add(this, text()); + setToolTip(text()); } } void UrlNavigatorButton::leaveEvent(QEvent* event) { UrlButton::leaveEvent(event); - QToolTip::remove(this); + setToolTip(QString()); } void UrlNavigatorButton::dropEvent(QDropEvent* event) @@ -258,7 +259,8 @@ void UrlNavigatorButton::startPopupDelay() return; } - m_popupDelay->start(300, true); + m_popupDelay->setSingleShot(true); + m_popupDelay->start(300); } void UrlNavigatorButton::stopPopupDelay() @@ -350,8 +352,8 @@ void UrlNavigatorButton::listJobFinished(KJob* job) int i = 0; while (it != itEnd) { dirsMenu->insertItem(*it, i); - ++i; ++it; + ++i; } int result = dirsMenu->exec(urlNavigator()->mapToGlobal(geometry().bottomLeft())); diff --git a/src/urlnavigatorbutton.h b/src/urlnavigatorbutton.h index f0a69ea34..b55bcb880 100644 --- a/src/urlnavigatorbutton.h +++ b/src/urlnavigatorbutton.h @@ -21,7 +21,6 @@ #define UrlNAVIGATORBUTTON_H #include -//Added by qt3to4: #include #include #include