[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeaddons/konq-plugins
From: Pascal Létourneau <pletourn () globetrotter ! net>
Date: 2005-08-17 1:34:35
Message-ID: 1124242475.766589.23496.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 449899 by pletourn:
Make it compile
M +2 -0 crashes/crashesplugin.cpp
M +1 -1 fsview/fsview.cpp
M +20 -26 fsview/treemap.cpp
M +1 -1 fsview/treemap.h
M +13 -13 searchbar/searchbar.cpp
M +1 -1 uachanger/uachangerplugin.cpp
--- trunk/KDE/kdeaddons/konq-plugins/crashes/crashesplugin.cpp \
#449898:449899 @@ -36,6 +36,8 @@
//Added by qt3to4:
#include <Q3CString>
+#include <limits.h>
+
typedef KGenericFactory<CrashesPlugin> CrashesPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libcrashesplugin, CrashesPluginFactory( \
"crashesplugin" ) )
--- trunk/KDE/kdeaddons/konq-plugins/fsview/fsview.cpp #449898:449899
@@ -135,7 +135,7 @@
if (!fi.isDir()) {
_path = fi.dirPath(true);
}
- _pathDepth = _path.contains('/');
+ _pathDepth = _path.count('/');
KURL u;
u.setPath(_path);
--- trunk/KDE/kdeaddons/konq-plugins/fsview/treemap.cpp #449898:449899
@@ -38,6 +38,9 @@
#include <QResizeEvent>
#include <QMouseEvent>
+#include <QStylePainter>
+#include <QStyleOptionFocusRect>
+
#include <klocale.h>
#include <kconfig.h>
#include <kdebug.h>
@@ -1078,33 +1081,22 @@
<< last->width() << "x" << last->height() << ")" << endl;
}
-
-// Tooltips for TreeMapWidget
-
-class TreeMapTip: public QToolTip
+bool TreeMapWidget::event( QEvent* e )
{
-public:
- TreeMapTip( QWidget* p ):QToolTip(p) {}
-
-protected:
- void maybeTip( const QPoint & );
-};
-
-void TreeMapTip::maybeTip( const QPoint& pos )
-{
- if ( !parentWidget()->inherits( "TreeMapWidget" ) )
- return;
-
- TreeMapWidget* p = (TreeMapWidget*)parentWidget();
- TreeMapItem* i;
- i = p->item(pos.x(), pos.y());
+ if ( e->type() == QEvent::ToolTip ) {
+
+ QPoint pos = static_cast<QHelpEvent*>(e)->pos();
+ TreeMapItem* i = item(pos.x(), pos.y());
Q3PtrList<QRect>* rList = i ? i->freeRects() : 0;
if (rList) {
QRect* r;
for(r=rList->first();r;r=rList->next())
- if (r->contains(pos))
- tip(*r, p->tipString(i));
+ if (r->contains( pos ))
+ QToolTip::showText( static_cast<QHelpEvent*>(e)->globalPos(), \
tipString(i), this); }
+ return true;
+ }
+ return QWidget::event( e );
}
@@ -1150,7 +1142,6 @@
setBackgroundMode(Qt::NoBackground);
setFocusPolicy(Qt::StrongFocus);
- _tip = new TreeMapTip(this);
}
TreeMapWidget::~TreeMapWidget()
@@ -2158,10 +2149,13 @@
QWidget::width(), QWidget::height()/*, CopyROP, true*/);
if (hasFocus()) {
- QPainter p(this);
- style().drawPrimitive( QStyle::PE_FocusRect, &p,
- QRect(0, 0, QWidget::width(), \
QWidget::height()),
- colorGroup() );
+ QStylePainter p(this);
+ QStyleOptionFocusRect opt;
+ opt.rect = rect();
+ opt.palette = palette();
+ opt.state = QStyle::State_None;
+
+ p.drawPrimitive( QStyle::PE_FrameFocusRect, opt );
}
}
--- trunk/KDE/kdeaddons/konq-plugins/fsview/treemap.h #449898:449899
@@ -688,6 +688,7 @@
void resizeEvent( QResizeEvent * );
void showEvent( QShowEvent * );
void fontChange( const QFont& );
+ bool event( QEvent* e );
private:
TreeMapItemList diff(TreeMapItemList&, TreeMapItemList&);
@@ -709,7 +710,6 @@
TreeMapItem* _base;
TreeMapItem *_current, *_pressed, *_lastOver, *_oldCurrent;
- TreeMapTip* _tip;
int _maxSelectDepth, _maxDrawingDepth;
// attributes for field, per textNo
--- trunk/KDE/kdeaddons/konq-plugins/searchbar/searchbar.cpp #449898:449899
@@ -80,7 +80,7 @@
m_searchCombo->setWhatsThis( i18n("Search Bar<p>"
"Enter a search term. Click on the \
icon to change search mode or provider."));
- new KAction( i18n( "Focus Searchbar" ), CTRL+Key_S,
+ new KAction( i18n( "Focus Searchbar" ), Qt::CTRL+Qt::Key_S,
this, SLOT(focusSearchbar()),
actionCollection(), "focus_search_bar");
@@ -114,14 +114,14 @@
if( o==m_searchCombo->lineEdit() && e->type() == QEvent::KeyPress )
{
QKeyEvent *k = (QKeyEvent *)e;
- if(k->state() & ControlButton)
+ if(k->state() & Qt::ControlButton)
{
- if(k->key()==Key_Down)
+ if(k->key()==Qt::Key_Down)
{
nextSearchEntry();
return true;
}
- if(k->key()==Key_Up)
+ if(k->key()==Qt::Key_Up)
{
previousSearchEntry();
return true;
@@ -138,7 +138,7 @@
m_searchMode = UseSearchProvider;
if(m_searchEngines.count())
{
- m_currentEngine = *m_searchEngines.at(0);
+ m_currentEngine = m_searchEngines.at(0);
}
else
{
@@ -290,9 +290,10 @@
arrowmap.fill(m_searchCombo->lineEdit()->backgroundColor());
QPainter p( &arrowmap );
p.drawPixmap(0, 2, m_searchIcon);
- QStyle::SFlags arrowFlags = QStyle::Style_Default;
- m_searchCombo->style().drawPrimitive(QStyle::PE_ArrowDown, &p, \
QRect(arrowmap.width()-6,
- arrowmap.height()-5, 6, 5), m_searchCombo->colorGroup(), arrowFlags, \
QStyleOption() ); + QStyleOption opt;
+ opt.state = QStyle::State_None;
+ opt.rect = QRect( arrowmap.width()-6, arrowmap.height()-5, 6, 5 );
+ m_searchCombo->style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, \
&opt, &p, m_searchCombo ); p.end();
m_searchIcon = arrowmap;
@@ -362,7 +363,7 @@
return;
}
m_searchMode = UseSearchProvider;
- m_currentEngine = *m_searchEngines.at(id);
+ m_currentEngine = m_searchEngines.at(id);
setIcon();
}
@@ -459,9 +460,7 @@
void SearchBarPlugin::focusSearchbar()
{
- QFocusEvent::setReason( QFocusEvent::Shortcut );
- m_searchCombo->setFocus();
- QFocusEvent::resetReason();
+ m_searchCombo->setFocus( Qt::ShortcutFocusReason );
}
SearchBarCombo::SearchBarCombo(QWidget *parent, const char *name) :
@@ -508,7 +507,8 @@
void SearchBarCombo::mousePressEvent(QMouseEvent *e)
{
- int x0 = QStyle::visualRect( style().querySubControlMetrics( \
QStyle::CC_ComboBox, this, QStyle::SC_ComboBoxEditField ), this ).x(); \
+ QStyleOptionComplex opt; + int x0 = QStyle::visualRect( \
layoutDirection(), style()->subControlRect( QStyle::CC_ComboBox, &opt, \
QStyle::SC_ComboBoxEditField, this ), rect() ).x();
if(e->x() > x0 + 2 && e->x() < lineEdit()->x())
{
--- trunk/KDE/kdeaddons/konq-plugins/uachanger/uachangerplugin.cpp \
#449898:449899 @@ -338,7 +338,7 @@
void UAChangerPlugin::updateIOSlaves ()
{
// Inform running http(s) io-slaves about the change...
- if (!DCOPRef("*", "KIO::Scheduler").send("reparseSlaveConfiguration", \
QString::null)) + if (!DCOPRef("*", \
"KIO::Scheduler").send("reparseSlaveConfiguration", \
QString()))
kdWarning() << "UAChangerPlugin::updateIOSlaves: Unable to update \
running application!" << endl; }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic