From a7fd1ce8682b8ca889960e8de539ab9c5886888f Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 5 May 2008 18:37:18 +0000 Subject: [PATCH] clean this up a bit svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=804345 --- CMakeLists.txt | 1 - widgets/CMakeLists.txt | 1 - widgets/tests/CMakeLists.txt | 17 ----- widgets/tests/testLayouts.cpp | 70 ------------------ widgets/tests/testProgressBar.cpp | 113 ------------------------------ 5 files changed, 202 deletions(-) delete mode 100644 widgets/CMakeLists.txt delete mode 100644 widgets/tests/CMakeLists.txt delete mode 100644 widgets/tests/testLayouts.cpp delete mode 100644 widgets/tests/testProgressBar.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d5adabfd..3c5620aa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ include (KDE4Defaults) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${KDEBASE_WORKSPACE_SOURCE_DIR}/libs ${CMAKE_CURRENT_SOURCE_DIR}/.. ${KDE4_INCLUDES} ${OPENGL_INCLUDE_DIR}) -add_subdirectory(widgets) #add_subdirectory(tests) add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1209) diff --git a/widgets/CMakeLists.txt b/widgets/CMakeLists.txt deleted file mode 100644 index ac3b18770..000000000 --- a/widgets/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -#add_subdirectory( tests ) diff --git a/widgets/tests/CMakeLists.txt b/widgets/tests/CMakeLists.txt deleted file mode 100644 index 0d3c36776..000000000 --- a/widgets/tests/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -########### testLayouts ############### - -set(testlayouts_SRCS - testLayouts.cpp -) - -kde4_add_executable(testLayouts ${testlayouts_SRCS} ) -target_link_libraries( testLayouts ${KDE4_KDEUI_LIBS} plasma) - -set(testProgressBar_SRCS - testProgressBar.cpp -) - -kde4_add_executable( testProgressBar ${testProgressBar_SRCS} ) -target_link_libraries( testProgressBar ${KDE4_KDEUI_LIBS} plasma) - diff --git a/widgets/tests/testLayouts.cpp b/widgets/tests/testLayouts.cpp deleted file mode 100644 index c7c9cfbb7..000000000 --- a/widgets/tests/testLayouts.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "plasma/layouts/boxlayout.h" -#include "plasma/widgets/pushbutton.h" -#include "plasma/widgets/lineedit.h" -#include "plasma/widgets/widget.h" -#include "plasma/widgets/label.h" - -int main(int argc, char **argv) -{ - KAboutData aboutData( QByteArray("test"), 0, ki18n("test"), - KDE_VERSION_STRING, ki18n("test"), KAboutData::License_BSD, - ki18n("test") ); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - QGraphicsView view; - QGraphicsScene scene; - view.setScene(&scene); - - Plasma::VBoxLayout *widgetLayout = new Plasma::VBoxLayout(0); - widgetLayout->setGeometry( QRectF(0.0, 0.0, 400.0, 700.0) ); - - Plasma::HBoxLayout *h1 = new Plasma::HBoxLayout( 0 ); - Plasma::HBoxLayout *h2 = new Plasma::HBoxLayout( 0 ); - widgetLayout->addItem( h1 ); - widgetLayout->addItem( h2 ); - - // should be first row - Plasma::PushButton *pushOne = new Plasma::PushButton("pushbutton one"); - h1->addItem(pushOne); - scene.addItem(pushOne); - - Plasma::LineEdit *editOne = new Plasma::LineEdit; - h1->addItem(editOne); - scene.addItem(editOne); - - Plasma::Label *labelOne = new Plasma::Label( 0 ); - labelOne->setText( "hello world 1" ); - h1->addItem(labelOne); - scene.addItem(labelOne); - - // should be second row - Plasma::PushButton *pushTwo = new Plasma::PushButton("pushbutton two"); - h2->addItem(pushTwo); - scene.addItem(pushTwo); - - Plasma::LineEdit *editTwo = new Plasma::LineEdit; - h2->addItem(editTwo); - scene.addItem(editTwo); - - Plasma::Label *labelTwo = new Plasma::Label( 0 ); - labelTwo->setText( "hello world 2" ); - h2->addItem(labelTwo); - scene.addItem(labelTwo); - - widgetLayout->updateGeometry(); - - view.show(); - return app.exec(); -} - diff --git a/widgets/tests/testProgressBar.cpp b/widgets/tests/testProgressBar.cpp deleted file mode 100644 index 0f1893646..000000000 --- a/widgets/tests/testProgressBar.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -#include "plasma/layouts/boxlayout.h" -#include "plasma/widgets/progressbar.h" - -class Counter : QObject -{ - Q_OBJECT - -public: - Counter(Plasma::ProgressBar *p); - ~Counter(); - - void start(); - -private Q_SLOTS: - void updateValue(); - -private: - - QTimer timer; - Plasma::ProgressBar *pbar; - int seconds; - -}; - - -Counter::Counter(Plasma::ProgressBar *p) - : QObject(), timer(0) -{ - seconds = 10; - pbar = p; - -} - -Counter::~Counter() -{ -} - -void Counter::start() -{ - connect(&timer, SIGNAL(timeout()), - this, SLOT(updateValue())); - - timer.start(100); -} - -void Counter::updateValue() -{ - int inc = 1; - - pbar->setValue(pbar->value() + inc); - - if (pbar->value() >= 100) { - timer.stop(); - } -} - -int main(int argc, char **argv) -{ - KAboutData aboutData(QByteArray("test"), 0, ki18n("test"), - KDE_VERSION_STRING, ki18n("test"), KAboutData::License_BSD, - ki18n("test")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - QGraphicsView view; - QGraphicsScene scene; - view.setScene(&scene); - - Plasma::VBoxLayout *widgetLayout = new Plasma::VBoxLayout(0); - widgetLayout->setGeometry(QRectF(0.0, 0.0, 350.0, 30.0)); - - Plasma::HBoxLayout *h1 = new Plasma::HBoxLayout(0); - widgetLayout->addItem(h1); - - Plasma::ProgressBar *progressBar = new Plasma::ProgressBar(0); - h1->addItem(progressBar); - scene.addItem(progressBar); - - widgetLayout->updateGeometry(); - - view.show(); - - Counter *c = new Counter(progressBar); - c->start(); - -// Uncomment for hide the text. -// progressBar->setTextVisible( false ); -// -// Uncomment for change the progressbar alignment -// progressBar->setAlignment( Qt::AlignRight ); -// -// Uncomment in order to invert the progress, from right to left. -// progressBar->setInvertedAppearance( true );; - - progressBar->setGeometry(QRectF(0, 0, 200, 30)); - - - return app.exec(); -} - -#include "testLayouts.moc"