1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-04 17:30:55 +00:00

reducing a little bit the number of deprecation warnings

svn path=/trunk/playground/utils/dolphin/; revision=610300
This commit is contained in:
Zack Rusin 2006-12-04 05:46:34 +00:00
parent c94276725b
commit 01f577fda1
8 changed files with 31 additions and 28 deletions

View File

@ -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);

View File

@ -50,7 +50,7 @@ DolphinMainWindow* DolphinApplication::createMainWindow()
void DolphinApplication::removeMainWindow( DolphinMainWindow *mainwindow )
{
m_mainWindows.remove( mainwindow );
m_mainWindows.removeAll( mainwindow );
}
void DolphinApplication::refreshMainWindows()

View File

@ -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)) {

View File

@ -29,7 +29,7 @@
#include <Q3ValueList>
#include <QDropEvent>
#include <QMouseEvent>
#include <Q3VBoxLayout>
#include <QVBoxLayout>
#include <kurl.h>
#include <klocale.h>
#include <kio/netaccess.h>
@ -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];

View File

@ -27,7 +27,7 @@
#include <QDropEvent>
#include <Q3ValueList>
#include <QMouseEvent>
#include <Q3VBoxLayout>
#include <QVBoxLayout>
#include <kparts/part.h>
#include <kfileitem.h>
#include <kfileiconview.h>
@ -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;

View File

@ -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 {

View File

@ -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()));

View File

@ -21,7 +21,6 @@
#define UrlNAVIGATORBUTTON_H
#include <qstringlist.h>
//Added by qt3to4:
#include <QEvent>
#include <QDragLeaveEvent>
#include <QDropEvent>