Diffstat (limited to 'microkde/kdeui/kmainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/kmainwindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/microkde/kdeui/kmainwindow.cpp b/microkde/kdeui/kmainwindow.cpp index 3ae4c87..fa678f2 100644 --- a/microkde/kdeui/kmainwindow.cpp +++ b/microkde/kdeui/kmainwindow.cpp @@ -24,65 +24,65 @@ #include <qobjectlist.h> #include <qstringlist.h> #include <qtimer.h> #include <qmenubar.h> #include <qstatusbar.h> #include <qapplication.h> #include "kdebug.h" #include "kmainwindow.h" #include "kglobalsettings.h" #include "kactioncollection.h" class KMainWindowPrivate { public: //US bool showHelpMenu:1; bool autoSaveSettings:1; bool settingsDirty:1; bool autoSaveWindowSize:1; bool care_about_geometry:1; QString autoSaveGroup; //US KAccel * kaccel; //US KMainWindowInterface *m_interface; KDEPrivate::ToolBarHandler *toolBarHandler; QTimer* settingsTimer; KToggleAction *showStatusBarAction; QRect defaultWindowSize; }; static bool no_query_exit = false; -KMainWindow::KMainWindow( QWidget* parent, const char *name, WFlags f ) +KMainWindow::KMainWindow( QWidget* parent, const char *name ) : QMainWindow( parent, name ) /*LR, f ) with the default widget flag we cannot have fastload */ /*US, KXMLGUIBuilder( this ), helpMenu2( 0 ), factory_( 0 )*/ { mQToolBar = 0; initKMainWindow(name); } void KMainWindow::parseGeometry(bool parsewidth) { //US the following code is not getting used in the embedded version !! So disable it for now /*US assert ( !kapp->geometryArgument().isNull() ); assert ( d->care_about_geometry ); #ifndef Q_WS_QWS // FIXME: (E) Implement something similar for Qt Embedded (or decide we don't need it) int x, y; int w, h; int m = XParseGeometry( kapp->geometryArgument().latin1(), &x, &y, (unsigned int*)&w, (unsigned int*)&h); if (parsewidth) { QSize minSize = minimumSize(); QSize maxSize = maximumSize(); if ( (m & WidthValue) == 0 ) w = width(); if ( (m & HeightValue) == 0 ) h = height(); w = QMIN(w,maxSize.width()); h = QMIN(h,maxSize.height()); w = QMAX(w,minSize.width()); h = QMAX(h,minSize.height()); resize(w, h); } else { @@ -818,68 +818,69 @@ bool KMainWindow::initialGeometrySet() const void KMainWindow::ignoreInitialGeometry() { d->care_about_geometry = false; } void KMainWindow::setSettingsDirty() { //kdDebug(200) << "KMainWindow::setSettingsDirty" << endl; d->settingsDirty = true; if ( d->autoSaveSettings ) { // Use a timer to save "immediately" user-wise, but not too immediately // (to compress calls and save only once, in case of multiple changes) if ( !d->settingsTimer ) { d->settingsTimer = new QTimer( this ); connect( d->settingsTimer, SIGNAL( timeout() ), SLOT( saveAutoSaveSettings() ) ); } d->settingsTimer->start( 500, true ); } } bool KMainWindow::settingsDirty() const { return d->settingsDirty; } QString KMainWindow::settingsGroup() const { return d->autoSaveGroup; } -void KMainWindow::resizeEvent( QResizeEvent * ) +void KMainWindow::resizeEvent( QResizeEvent * e) { if ( d->autoSaveWindowSize ) - setSettingsDirty(); + setSettingsDirty(); + QMainWindow::resizeEvent( e ); } bool KMainWindow::hasMenuBar() { return (internalMenuBar()); } //US KMenuBar *KMainWindow::menuBar() QMenuBar *KMainWindow::menuBar() { //US KMenuBar * mb = internalMenuBar(); QMenuBar * mb = internalMenuBar(); if ( !mb ) { //US mb = new KMenuBar( this ); mb = new QMenuBar( this ); // trigger a re-layout and trigger a call to the private // setMenuBar method. QMainWindow::menuBar(); } return mb; } //US KStatusBar *KMainWindow::statusBar() QStatusBar *KMainWindow::statusBar() { //US KStatusBar * sb = internalStatusBar(); QStatusBar * sb = internalStatusBar(); if ( !sb ) { //US sb = new KStatusBar( this ); sb = new QStatusBar( this ); // trigger a re-layout and trigger a call to the private // setStatusBar method. @@ -911,67 +912,67 @@ QMenuBar *KMainWindow::internalMenuBar() if ( !l || !l->first() ) { delete l; return 0; } //US KMenuBar *m = (KMenuBar*)l->first(); QMenuBar *m = (QMenuBar*)l->first(); delete l; return m; } //US KStatusBar *KMainWindow::internalStatusBar() QStatusBar *KMainWindow::internalStatusBar() { //US QObjectList *l = queryList( "KStatusBar", 0, false, false ); QObjectList *l = queryList( "QStatusBar", 0, false, false ); if ( !l || !l->first() ) { delete l; return 0; } //US KStatusBar *s = (KStatusBar*)l->first(); QStatusBar *s = (QStatusBar*)l->first(); delete l; return s; } void KMainWindow::childEvent( QChildEvent* e) { QMainWindow::childEvent( e ); } -void KMainWindow::paintEvent( QPaintEvent * ) +void KMainWindow::paintEvent( QPaintEvent * e) { - // do nothing + QMainWindow::paintEvent( e ); } QSize KMainWindow::sizeForCentralWidgetSize(QSize size) { KToolBar *tb = (KToolBar*)child( "mainToolBar", "KToolBar" ); if (tb && !tb->isHidden()) { switch( tb->barPos() ) { case KToolBar::Top: case KToolBar::Bottom: size += QSize(0, tb->sizeHint().height()); break; case KToolBar::Left: case KToolBar::Right: size += QSize(toolBar()->sizeHint().width(), 0); break; case KToolBar::Flat: //US size += QSize(0, 3+kapp->style().pixelMetric( QStyle::PM_DockWindowHandleExtent )); size += QSize(0, tb->sizeHint().height()); break; default: break; } } //US KMenuBar *mb = menuBar(); QMenuBar *mb = menuBar(); if (!mb->isHidden()) { size += QSize(0,mb->heightForWidth(size.width())); /*US if (style().styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, this)) |