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);
connect(m_bookmarksMenu, SIGNAL(activated(int)),
this, SLOT(slotBookmarkActivated(int)));
- setPopup(m_bookmarksMenu);
+ setMenu(m_bookmarksMenu);
}
BookmarkSelector::~BookmarkSelector()
const int length = bookmarkUrl.prettyUrl().length();
if (length > maxLength) {
m_selectedIndex = i;
- setPixmap(SmallIcon(bookmark.icon()));
+ setIcon(SmallIcon(bookmark.icon()));
maxLength = length;
}
}
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"));
}
}
foregroundColor = KGlobalSettings::highlightedTextColor();
}
else {
- backgroundColor = colorGroup().background();
+ backgroundColor = palette().brush(QPalette::Background).color();
foregroundColor = KGlobalSettings::buttonTextColor();
}
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);
void DolphinApplication::removeMainWindow( DolphinMainWindow *mainwindow )
{
- m_mainWindows.remove( mainwindow );
+ m_mainWindows.removeAll( mainwindow );
}
void DolphinApplication::refreshMainWindows()
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)) {
#include <Q3ValueList>
#include <QDropEvent>
#include <QMouseEvent>
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
#include <kurl.h>
#include <klocale.h>
#include <kio/netaccess.h>
m_filterBar(0)
{
setFocusPolicy(Qt::StrongFocus);
- m_topLayout = new Q3VBoxLayout(this);
+ m_topLayout = new QVBoxLayout(this);
connect(this, SIGNAL(signalModeChanged()),
mainWindow, SLOT(slotViewModeChanged()));
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];
#include <QDropEvent>
#include <Q3ValueList>
#include <QMouseEvent>
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
#include <kparts/part.h>
#include <kfileitem.h>
#include <kfileiconview.h>
bool m_showProgress;
Mode m_mode;
- Q3VBoxLayout* m_topLayout;
+ QVBoxLayout* m_topLayout;
UrlNavigator* m_urlNavigator;
DolphinIconsView* m_iconsView;
DolphinStatusBar* m_statusBar;
}
QStringList urls = m_pathBox->urls();
- urls.remove(typedUrl.url());
+ urls.removeAll(typedUrl.url());
urls.prepend(typedUrl.url());
m_pathBox->setUrls(urls, KUrlComboBox::RemoveBottom);
QString host = m_host->text();
QString user;
- int marker = host.find("@");
+ int marker = host.indexOf("@");
if (marker != -1)
{
user = host.left(marker);
host = host.right(host.length() - marker - 1);
}
- marker = host.find("/");
+ marker = host.indexOf("/");
if (marker != -1)
{
u.setPath(host.right(host.length() - marker));
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
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();
// 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 {
void UrlNavigatorButton::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
+ painter.setClipRect(event->rect());
const int buttonWidth = width();
const int buttonHeight = height();
foregroundColor = KGlobalSettings::highlightedTextColor();
}
else {
- backgroundColor = colorGroup().background();
+ backgroundColor = palette().brush(QPalette::Background).color();
foregroundColor = KGlobalSettings::buttonTextColor();
}
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);
// 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)
return;
}
- m_popupDelay->start(300, true);
+ m_popupDelay->setSingleShot(true);
+ m_popupDelay->start(300);
}
void UrlNavigatorButton::stopPopupDelay()
int i = 0;
while (it != itEnd) {
dirsMenu->insertItem(*it, i);
- ++i;
++it;
+ ++i;
}
int result = dirsMenu->exec(urlNavigator()->mapToGlobal(geometry().bottomLeft()));
#define UrlNAVIGATORBUTTON_H
#include <qstringlist.h>
-//Added by qt3to4:
#include <QEvent>
#include <QDragLeaveEvent>
#include <QDropEvent>