[Kst] branches/work/kst/portto4/kst/src/libkstapp

Adam Treat treat at kde.org
Tue Mar 13 18:49:22 CET 2007


SVN commit 642224 by treat:

* Everything compiles now except kst.cpp...


 M  +1 -1      CMakeLists.txt  
 M  +6 -5      kstviewwidget.cpp  
 M  +33 -35    kstviewwindow.cpp  
 M  +2 -4      kstviewwindow.h  
 M  +4 -4      updatethread-multicore.cpp  
 M  +5 -5      updatethread-multicore.h  
 M  +1 -1      updatethread.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/CMakeLists.txt #642223:642224
@@ -107,7 +107,7 @@
    statuslabel.cpp
 #    treetools.cpp
    updatethread.cpp
-   updatethread-multicore.cpp
+#   updatethread-multicore.cpp
    )
 
 kde4_automoc(${kstapp_LIB_SRCS})
--- branches/work/kst/portto4/kst/src/libkstapp/kstviewwidget.cpp #642223:642224
@@ -19,7 +19,6 @@
 
 #include <qdebug.h>
 #include <qapplication.h>
-#include <kmultipledrag.h>
 
 #include "kst.h"
 #include "kstviewobjectimagedrag.h"
@@ -46,7 +45,7 @@
   setDragEnabled(true);
   setDropEnabled(true);
   setMouseTracking(true);
-  setFocusPolicy(QWidget::StrongFocus);
+  setFocusPolicy(Qt::StrongFocus);
   setBackgroundMode(Qt::NoBackground);
   setMinimumSize(40, 25);
   _vo_datamode = 0L;
@@ -59,7 +58,8 @@
 
 
 Q3DragObject *KstViewWidget::dragObject() {
-  KMultipleDrag *drag = new KMultipleDrag(this);
+  //FIXME PORT!
+  /*KMultipleDrag *drag = new KMultipleDrag(this);
 #if 1
   QStringList plots;
   KstViewObjectList vol;
@@ -90,7 +90,8 @@
   drag->addDragObject(new KstPlotDrag(...));
 #endif
 
-  return drag;
+  return drag;*/
+  return 0;
 }
 
 
@@ -492,7 +493,7 @@
     }
     return;
   } else if (_view->viewMode() == KstTopLevelView::LayoutMode) {
-    ButtonState s = e->stateAfter();
+    Qt::KeyboardModifiers s = e->modifiers();
     if (e->key() == Qt::Key_Escape) {
       _view->cancelMouseOperations();
       return;
--- branches/work/kst/portto4/kst/src/libkstapp/kstviewwindow.cpp #642223:642224
@@ -39,21 +39,21 @@
 #define KST_STATUSBAR_DATA 1
 #define KST_STATUSBAR_STATUS 2
 
-KstViewWindow::KstViewWindow(QWidget *parent)
+KstViewWindow::KstViewWindow(QWidget *parent, const QString &name, Qt::WindowFlags fl)
 : KMdiChildView(parent) {
   commonConstructor();
-  _view = new KstTopLevelView(this, name);
+  _view = new KstTopLevelView(this, name, fl);
 }
 
 
-KstViewWindow::KstViewWindow(const QDomElement& e, QWidget* parent)
+KstViewWindow::KstViewWindow(const QDomElement& e, QWidget* parent, Qt::WindowFlags fl)
 : KMdiChildView(parent) {
   QString in_tag;
   QRect rectRestore;
   QRect rectInternal;
 
   commonConstructor();
-  _view = new KstTopLevelView(e, this);
+  _view = new KstTopLevelView(e, this, fl);
 
   QDomNode n = e.firstChild();
   while (!n.isNull()) {
@@ -62,23 +62,23 @@
       if (e.tagName() == "tag") {
         in_tag = e.text();
         setWindowTitle(in_tag);
-        setTabCaption(in_tag);
+//FIXME PORT!         setTabCaption(in_tag);
       } else if (e.tagName() == "restore") {
         rectRestore.setX( e.attribute( "x", "0" ).toInt() );
         rectRestore.setY( e.attribute( "y", "0" ).toInt() );
         rectRestore.setWidth( e.attribute( "w", "100" ).toInt() );
         rectRestore.setHeight( e.attribute( "h", "100" ).toInt() );
-        setRestoreGeometry( rectRestore );
+//FIXME PORT!         setRestoreGeometry( rectRestore );
       } else if (e.tagName() == "internal") {
         rectInternal.setX( e.attribute( "x", "0" ).toInt() );
         rectInternal.setY( e.attribute( "y", "0" ).toInt() );
         rectInternal.setWidth( e.attribute( "w", "100" ).toInt() );
         rectInternal.setHeight( e.attribute( "h", "100" ).toInt() );
-        setInternalGeometry( rectInternal );
+//FIXME PORT!        setInternalGeometry( rectInternal );
       } else if (e.tagName() == "minimize") {
-        minimize(false);
+//FIXME PORT!        minimize(false);
       } else if (e.tagName() == "maximize") {
-        maximize(false);
+//FIXME PORT!        maximize(false);
       }
     }
     n = n.nextSibling();
@@ -87,8 +87,6 @@
 
 
 void KstViewWindow::commonConstructor() {
-  config = kapp->config();
-
   connect(this, SIGNAL(focusInEventOccurs( KMdiChildView*)), this, SLOT(slotActivated(KMdiChildView*)));
 
   QTimer::singleShot(0, this, SLOT(updateActions()));
@@ -261,7 +259,6 @@
       right = ( 72 * size.height() ) / resolution;
       bottom = ( 72 * size.width() ) / resolution;
 
-      printer.setMargins(0, 0, 0, 0);
       printer.setResolution(resolution);
       printer.setPageSize(QPrinter::Letter);
       printer.setOrientation(QPrinter::Landscape);
@@ -384,29 +381,30 @@
 
 
 void KstViewWindow::save(QTextStream& ts, const QString& indent) {
-  const QRect restoreGeom(restoreGeometry());
-  const QRect internalGeom(internalGeometry());
-
-  ts << indent << "<tag>" << Q3StyleSheet::escape(caption()) << "</tag>" << endl;
-
-  ts << indent << "<restore"  << " x=\"" << restoreGeom.x()
-    << "\" y=\"" << restoreGeom.y()
-    << "\" w=\"" << restoreGeom.width()
-    << "\" h=\"" << restoreGeom.height() << "\" />" << endl;
-
-  ts << indent << "<internal" << " x=\"" << internalGeom.x()
-    << "\" y=\"" << internalGeom.y()
-    << "\" w=\"" << internalGeom.width()
-    << "\" h=\"" << internalGeom.height() << "\" />" << endl;
-
-  if (isMinimized()) {
-    ts << indent << "<minimized/>" << endl;
-  }
-  if (isMaximized()) {
-    ts << indent << "<maximized/>" << endl;
-  }
-
-  view()->save(ts, indent);
+//FIXME PORT!
+//   const QRect restoreGeom(restoreGeometry());
+//   const QRect internalGeom(internalGeometry());
+// 
+//   ts << indent << "<tag>" << Q3StyleSheet::escape(caption()) << "</tag>" << endl;
+// 
+//   ts << indent << "<restore"  << " x=\"" << restoreGeom.x()
+//     << "\" y=\"" << restoreGeom.y()
+//     << "\" w=\"" << restoreGeom.width()
+//     << "\" h=\"" << restoreGeom.height() << "\" />" << endl;
+// 
+//   ts << indent << "<internal" << " x=\"" << internalGeom.x()
+//     << "\" y=\"" << internalGeom.y()
+//     << "\" w=\"" << internalGeom.width()
+//     << "\" h=\"" << internalGeom.height() << "\" />" << endl;
+// 
+//   if (isMinimized()) {
+//     ts << indent << "<minimized/>" << endl;
+//   }
+//   if (isMaximized()) {
+//     ts << indent << "<maximized/>" << endl;
+//   }
+// 
+//   view()->save(ts, indent);
 }
 
 
--- branches/work/kst/portto4/kst/src/libkstapp/kstviewwindow.h #642223:642224
@@ -45,8 +45,8 @@
 class KST_EXPORT KstViewWindow : public KMdiChildView {
   Q_OBJECT
   public:
-    KstViewWindow(QWidget *parent=0);
-    KstViewWindow(const QDomElement& e, QWidget *parent=0);
+    KstViewWindow(QWidget *parent, const QString &name, Qt::WindowFlags fl=0);
+    KstViewWindow(const QDomElement& e, QWidget *parent=0, Qt::WindowFlags fl=0);
     virtual ~KstViewWindow();
 
     /** pause the updating of data */
@@ -106,8 +106,6 @@
   private:
     void commonConstructor();
 
-    /** the configuration object of the application */
-    KConfig *config;
     KstTopLevelViewPtr _view;
 };
 
--- branches/work/kst/portto4/kst/src/libkstapp/updatethread-multicore.cpp #642223:642224
@@ -15,7 +15,7 @@
  *                                                                         *
  ***************************************************************************/
 
-#include "updatethread.h"
+#include "updatethread-multicore.h"
 
 #include <assert.h>
 
@@ -94,7 +94,7 @@
           continue;
         }
 
-        t->_queueCondition.wait();
+        t->_queueCondition.wait(&t->_updateQueueMutex);
       }
       // FIXME need to signify to the update thread that we're dead
     }
@@ -123,7 +123,7 @@
     updateTime = _updateTime;
     _statusMutex.unlock();
 
-    if (_waitCondition.wait(_updateTime)) {
+    if (_waitCondition.wait(&_statusMutex, _updateTime)) {
 #if UPDATEDEBUG > 0
       qDebug() << "Update timer " << _updateTime << endl;
 #endif
@@ -453,7 +453,7 @@
   if (empty) {
     return;
   }
-  _emptyQueueCondition.wait();
+  _emptyQueueCondition.wait(&_updateQueueMutex);
 }
 
 
--- branches/work/kst/portto4/kst/src/libkstapp/updatethread-multicore.h #642223:642224
@@ -20,10 +20,10 @@
 
 #include <qmutex.h>
 #include <qthread.h>
-#include <qvaluelist.h>
+#include <q3valuelist.h>
 
 #include <kstobject.h>
-#include "kstwaitcondition.h"
+#include <qwaitcondition.h>
 
 class KstBaseCurve;
 class KstDoc;
@@ -52,7 +52,7 @@
     KstObject::UpdateType updateResult() const;
     void waitForJobs();
 
-    KstWaitCondition _queueCondition, _emptyQueueCondition;
+    QWaitCondition _queueCondition, _emptyQueueCondition;
     int _updateCounter;
     KstObject::UpdateType _updateResult;
 
@@ -63,11 +63,11 @@
   private:
     bool _paused, _done;
     bool _force;
-    KstWaitCondition _waitCondition;
+    QWaitCondition _waitCondition;
     mutable QMutex _statusMutex;
     KstDoc *_doc;
     int _updateTime;
-    QValueList<KstBaseCurve*> _updatedCurves; // HACK: temporary use in update reworking
+    Q3ValueList<KstBaseCurve*> _updatedCurves; // HACK: temporary use in update reworking
     KstObjectList<KstObjectPtr> _updateQueue;
     QMutex _updateQueueMutex;
     mutable QMutex _jobCountMutex;
--- branches/work/kst/portto4/kst/src/libkstapp/updatethread.cpp #642223:642224
@@ -69,7 +69,7 @@
     updateTime = _updateTime;
     _statusMutex.unlock();
 
-    if (_waitCondition.wait(_updateTime)) {
+    if (_waitCondition.wait(&_statusMutex, _updateTime)) {
 #if UPDATEDEBUG > 0
       qDebug() << "Update timer " << _updateTime << endl;
 #endif


More information about the Kst mailing list