Commit [81c13b] Maximize Restore History

Merge remote branch 'johnybs/kde4-port_prebeta8'

Conflicts:
.gitignore
tests/math/matrixtester.cpp

Zoltan P Zoltan P 2010-03-29

added tests/simulator/CMakeLists.txt
removed src/eventinfo.cpp
removed src/recentfilesaction.cpp
removed src/recentfilesaction.h
changed tests/math/matrixtester.cpp
changed .gitignore
changed src/plugins/circuit/CMakeLists.txt
changed tests/math/matrixtester.cpp
changed tests/CMakeLists.txt
changed .gitignore
copied src/eventinfo.h -> tests/simulator/circuitcreate.cpp
tests/simulator/CMakeLists.txt Diff Switch to side-by-side view
Loading...
src/eventinfo.cpp
File was removed.
src/recentfilesaction.cpp
File was removed.
src/recentfilesaction.h
File was removed.
tests/math/matrixtester.cpp Diff Switch to side-by-side view
Loading...
.gitignore Diff Switch to side-by-side view
Loading...
src/plugins/circuit/CMakeLists.txt Diff Switch to side-by-side view
Loading...
tests/math/matrixtester.cpp Diff Switch to side-by-side view
Loading...
tests/CMakeLists.txt Diff Switch to side-by-side view
Loading...
.gitignore Diff Switch to side-by-side view
Loading...
src/eventinfo.h to tests/simulator/circuitcreate.cpp
--- a/src/eventinfo.h
+++ b/tests/simulator/circuitcreate.cpp
@@ -1,59 +1,53 @@
-/***************************************************************************
- *   Copyright (C) 2005 by David Saxton                                    *
- *   david@bluehaze.org                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+/*
+    Tests for circuit simulation. Tries to create a circuit. Can be used as 
+    reference for further tests.
+    
+    
+*/
+#include <QtCore/QObject>
 
-#ifndef EVENTINFO_H
-#define EVENTINFO_H
+#include <QtTest>
 
-#include <qpoint.h>
+#include <tests/autotestshell.h>
+#include <tests/testcore.h>
 
-class ItemView;
+#include <kdebug.h>
 
-class QCanvasItem;
-class QEvent;
-class QMouseEvent;
-class QWheelEvent;
+#include "plugins/circuit/circuitmodel.h"
 
-/**
-Contains information from for a mouse event that occured on a canvas. Like a
-QMouseEvent / QEvent / QWheelEvent, but abstracted to the canvas coordinate
-system, as well as holding lots of useful information.
-@author David Saxton
-*/
-class EventInfo
+using namespace KDevelop;
+
+using namespace KTechLab;
+
+class CircuitCreateTest : public QObject
 {
-public:
-	EventInfo();
-	EventInfo( ItemView *itemView, QMouseEvent *e );
-	EventInfo( ItemView *itemView, QWheelEvent *e );
-	EventInfo( ItemView *itemView, QEvent *e );
-	
-	QMouseEvent *mousePressEvent( int dx, int dy ) const;
-	QMouseEvent *mouseReleaseEvent( int dx, int dy ) const;
-	QMouseEvent *mouseDoubleClickEvent( int dx, int dy ) const;
-	QMouseEvent *mouseMoveEvent( int dx, int dy ) const;
-	QWheelEvent *wheelEvent( int dx, int dy ) const;
-	
-	QPoint pos;
-	QPoint globalPos;
-	QCanvasItem * qcanvasItemClickedOn;
-	short scrollDelta;
-	Qt::Orientation scrollOrientation;
-	bool isRightClick;
-	bool isMiddleClick;
-	bool ctrlPressed;
-	bool shiftPressed;
-	bool altPressed;
-	
-protected:
-	void extractPos( ItemView * itemView, const QPoint & contentsMouseClick );
-	void reset();
+  Q_OBJECT
+
+  private slots:
+
+    void init(){
+        AutoTestShell::init();
+        m_core = new KDevelop::TestCore();
+        m_core->initialize( KDevelop::Core::NoUi );
+    }
+    
+    void cleanup(){
+        m_core->cleanup();
+        delete m_core;
+    }
+    
+    void createDocument(){
+        CircuitModel m;
+        QVariantMap map;
+        m.addComponent(map); // take that !
+    }
+    
+  private:
+    
+    KDevelop::TestCore* m_core;
+    
 };
 
-#endif
+QTEST_MAIN(CircuitCreateTest)
+
+#include "circuitcreate.moc"