Ver código fonte

Remove splitter and widget stack from SourceFileWindow.

git-svn-id: file:///var/svn/tigccpp/trunk@586 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 anos atrás
pai
commit
c878e1991e
2 arquivos alterados com 4 adições e 40 exclusões
  1. 0 27
      ktigcc/srcfilewin.ui
  2. 4 13
      ktigcc/srcfilewin.ui.h

+ 0 - 27
ktigcc/srcfilewin.ui

@@ -15,32 +15,6 @@
     <property name="caption">
         <string>TIGCC IDE for KDE</string>
     </property>
-    <hbox>
-        <property name="name">
-            <cstring>unnamed</cstring>
-        </property>
-        <widget class="QSplitter">
-            <property name="name">
-                <cstring>splitter</cstring>
-            </property>
-            <property name="orientation">
-                <enum>Horizontal</enum>
-            </property>
-            <widget class="QWidgetStack">
-                <property name="name">
-                    <cstring>widgetStack</cstring>
-                </property>
-                <property name="sizePolicy">
-                    <sizepolicy>
-                        <hsizetype>7</hsizetype>
-                        <vsizetype>7</vsizetype>
-                        <horstretch>0</horstretch>
-                        <verstretch>0</verstretch>
-                    </sizepolicy>
-                </property>
-            </widget>
-        </widget>
-    </hbox>
 </widget>
 <menubar>
     <property name="name">
@@ -670,7 +644,6 @@
     <slot>findOpenFileAtCursor()</slot>
     <slot>findFindSymbolDeclaration()</slot>
     <slot>resizeEvent( QResizeEvent * event )</slot>
-    <slot>timerEvent( QTimerEvent * event )</slot>
     <slot>statusBar_messageChanged( const QString &amp; message )</slot>
     <slot>current_view_cursorPositionChanged()</slot>
     <slot>current_view_textChanged()</slot>

+ 4 - 13
ktigcc/srcfilewin.ui.h

@@ -40,6 +40,7 @@
 #include <qclipboard.h>
 #include <qaccel.h>
 #include <qeventloop.h>
+#include <qlayout.h>
 #include <kparts/factory.h>
 #include <klibloader.h>
 #include <kate/document.h>
@@ -185,9 +186,9 @@ void SourceFileWindow::init()
   connect(KDirWatch::self(),SIGNAL(dirty(const QString &)),this,SLOT(KDirWatch_dirty(const QString &)));
   KDirWatch::self()->startScan();
   connect(clipboard,SIGNAL(dataChanged()),this,SLOT(clipboard_dataChanged()));
-  widgetStack->addWidget(CURRENT_VIEW);
+  QVBoxLayout *layout=new QVBoxLayout(this);
+  layout->addWidget(CURRENT_VIEW);
   CURRENT_VIEW->show();
-  widgetStack->raiseWidget(CURRENT_VIEW);
   editUndoAction->setEnabled(!!(CURRENT_VIEW->getDoc()->undoCount()));
   editRedoAction->setEnabled(!!(CURRENT_VIEW->getDoc()->redoCount()));
   editClearAction->setEnabled(CURRENT_VIEW->getDoc()->hasSelection());
@@ -212,7 +213,6 @@ void SourceFileWindow::init()
   THIS->accel->setItemEnabled(6,TRUE);
   THIS->accel->setItemEnabled(7,TRUE);
   connect(THIS->accel,SIGNAL(activated(int)),this,SLOT(accel_activated(int)));
-  startTimer(100);
   THIS->kfinddialog = static_cast<KFindDialog *>(NULL);
   THIS->kreplace = static_cast<KReplaceWithSelectionS *>(NULL);
   if (preferences.useSystemIcons) {
@@ -341,7 +341,7 @@ void *SourceFileWindow::createView(const QString &fileName, const QString &fileT
   if (doc->openStream("text/plain",fileName))
     doc->closeStream();
   // Create View object.
-  Kate::View *newView = (Kate::View *) doc->createView( widgetStack, 0L );
+  Kate::View *newView = (Kate::View *) doc->createView( this, 0L );
   newView->hide();
   newView->setSizePolicy(QSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored,0,0));
   // Set highlighting mode.
@@ -955,15 +955,6 @@ void SourceFileWindow::resizeEvent(QResizeEvent *event)
   updateSizes();
 }
 
-void SourceFileWindow::timerEvent(QTimerEvent *event)
-{
-  static int lastSplitterPos=-1;
-  QMainWindow::timerEvent(event);
-  if (lastSplitterPos==splitter->sizes().first()) return;
-  lastSplitterPos=splitter->sizes().first();
-  updateSizes();
-}
-
 void SourceFileWindow::statusBar_messageChanged(const QString & message)
 {
   if (message.isNull())