[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kparts/tests
From: David Faure <faure () kde ! org>
Date: 2009-08-21 1:07:49
Message-ID: 1250816869.902998.14043.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1013872 by dfaure:
cleaning up those really old tests ;)
(missing licenses; don't load libkghostview; more sensible names, etc)
M +6 -6 CMakeLists.txt
D example.cpp
D example.h
D ghostview.cpp
D ghostview.h
D ghostviewtest_shell.rc
M +29 -9 normalktm.cpp
M +23 -3 normalktm.h
M +20 -8 notepad.cpp
M +21 -0 notepad.h
M +21 -4 parts.cpp
M +20 -0 parts.h
AM partviewer.cpp ghostview.cpp#1013836 [License: LGPL (v2/3+eV)]
AM partviewer.h ghostview.h#1013836 [License: LGPL (v2/3+eV)]
AM partviewer_shell.rc ghostviewtest_shell.rc#1013836
M +24 -2 plugin_spellcheck.cpp
M +20 -0 plugin_spellcheck.h
AM testmainwindow.cpp example.cpp#1013836 [License: LGPL (v2/3+eV)]
AM testmainwindow.h example.h#1013836 [License: LGPL (v2/3+eV)]
--- trunk/KDE/kdelibs/kparts/tests/CMakeLists.txt #1013871:1013872
@@ -5,7 +5,7 @@
########### next target ###############
set(kpartstest_SRCS
-example.cpp
+testmainwindow.cpp
parts.cpp
notepad.cpp
)
@@ -32,12 +32,12 @@
########### next target ###############
-set(ghostviewtest_SRCS
-ghostview.cpp
+set(partviewer_SRCS
+partviewer.cpp
)
-kde4_add_executable(ghostviewtest TEST ${ghostviewtest_SRCS})
-target_link_libraries(ghostviewtest ${KDE4_KPARTS_LIBS} )
+kde4_add_executable(partviewer TEST ${partviewer_SRCS})
+target_link_libraries(partviewer ${KDE4_KPARTS_LIBS} )
########### next target ###############
@@ -88,7 +88,7 @@
# Normally this would be needed. For the test programs we can avoid that, see \
addResourceDir. #install( FILES notepadpart.rc DESTINATION \
${DATA_INSTALL_DIR}/notepadpart )
-#install( FILES ghostviewtest_shell.rc DESTINATION \
${DATA_INSTALL_DIR}/ghostviewtest ) +#install( FILES partviewer_shell.rc DESTINATION \
${DATA_INSTALL_DIR}/partviewer ) #install( FILES kpartstest_shell.rc DESTINATION \
${DATA_INSTALL_DIR}/kpartstest ) #install( FILES kpartstest_part1.rc DESTINATION \
${DATA_INSTALL_DIR}/kpartstestpart )
--- trunk/KDE/kdelibs/kparts/tests/normalktm.cpp #1013871:1013872
@@ -1,4 +1,24 @@
+/*
+ Copyright (c) 2000 David Faure <faure@kde.org>
+ Copyright (c) 2000 Simon Hausmann <hausmann@kde.org>
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
#include "normalktm.h"
#include "parts.h"
#include "notepad.h"
@@ -19,7 +39,7 @@
#include <kmenubar.h>
#include <kicon.h>
-Shell::Shell()
+TestMainWindow::TestMainWindow()
: KXmlGuiWindow()
{
// We can do this "switch active part" because we have a splitter with
@@ -68,24 +88,24 @@
m_editorpart = 0;
}
-Shell::~Shell()
+TestMainWindow::~TestMainWindow()
{
}
-void Shell::slotFileOpen()
+void TestMainWindow::slotFileOpen()
{
if ( !m_part1->openUrl( KStandardDirs::locate("data", \
KGlobal::mainComponent().componentName()+"/kpartstest_shell.rc" ) ) ) \
KMessageBox::error(this, "Couldn't open file !"); }
-void Shell::slotFileOpenRemote()
+void TestMainWindow::slotFileOpenRemote()
{
KUrl u ( "http://www.kde.org/index.html" );
if ( !m_part1->openUrl( u ) )
KMessageBox::error(this, "Couldn't open file !");
}
-void Shell::embedEditor()
+void TestMainWindow::embedEditor()
{
// replace part2 with the editor part
delete m_part2;
@@ -98,7 +118,7 @@
m_paCloseEditor->setEnabled(true);
}
-void Shell::slotFileCloseEditor()
+void TestMainWindow::slotFileCloseEditor()
{
delete m_editorpart;
m_editorpart = 0;
@@ -109,7 +129,7 @@
m_paCloseEditor->setEnabled(false);
}
-void Shell::slotFileEdit()
+void TestMainWindow::slotFileEdit()
{
if ( !m_editorpart )
embedEditor();
@@ -120,11 +140,11 @@
int main( int argc, char **argv )
{
- // we cheat and call ourselves kpartstest for Shell::slotFileOpen()
+ // we cheat and call ourselves kpartstest for TestMainWindow::slotFileOpen()
KCmdLineArgs::init( argc, argv, "kpartstest", 0, ki18n("kpartstest"), 0);
KApplication app;
- Shell *shell = new Shell;
+ TestMainWindow *shell = new TestMainWindow;
shell->show();
app.exec();
--- trunk/KDE/kdelibs/kparts/tests/normalktm.h #1013871:1013872
@@ -1,4 +1,24 @@
+/*
+ Copyright (c) 2000 David Faure <faure@kde.org>
+ Copyright (c) 2000 Simon Hausmann <hausmann@kde.org>
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
#ifndef __normalktm_h__
#define __normalktm_h__
@@ -8,12 +28,12 @@
class KAction;
class QWidget;
-class Shell : public KXmlGuiWindow
+class TestMainWindow : public KXmlGuiWindow
{
Q_OBJECT
public:
- Shell();
- virtual ~Shell();
+ TestMainWindow();
+ virtual ~TestMainWindow();
protected Q_SLOTS:
void slotFileOpen();
--- trunk/KDE/kdelibs/kparts/tests/notepad.cpp #1013871:1013872
@@ -1,4 +1,24 @@
+/*
+ Copyright (c) 1999, 2000 David Faure <faure@kde.org>
+ Copyright (c) 1999, 2000 Simon Hausmann <hausmann@kde.org>
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
#include "notepad.h"
#include <kparts/partmanager.h>
#include <kparts/mainwindow.h>
@@ -103,14 +123,6 @@
void NotepadPart::slotSearchReplace()
{
- // What's this ? (David)
-/*
- QValueList<KParts::XMLGUIServant *> plugins = KParts::Plugin::pluginServants( this \
);
- QValueList<KParts::XMLGUIServant *>::ConstIterator it = plugins.begin();
- QValueList<KParts::XMLGUIServant *>::ConstIterator end = plugins.end();
- for (; it != end; ++it )
- factory()->removeServant( *it );
-*/
}
#include "notepad.moc"
--- trunk/KDE/kdelibs/kparts/tests/notepad.h #1013871:1013872
@@ -1,4 +1,25 @@
+/*
+ Copyright (c) 1999, 2000 David Faure <faure@kde.org>
+ Copyright (c) 1999, 2000 Simon Hausmann <hausmann@kde.org>
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
#ifndef notepad_h
#define notepad_h
--- trunk/KDE/kdelibs/kparts/tests/parts.cpp #1013871:1013872
@@ -1,4 +1,24 @@
+/*
+ Copyright (c) 1999, 2000 David Faure <faure@kde.org>
+ Copyright (c) 1999, 2000 Simon Hausmann <hausmann@kde.org>
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
#include <kparts/event.h>
#include "parts.h"
@@ -12,8 +32,7 @@
#include <QtGui/QTextEdit>
#include <QtGui/QLineEdit>
-#include <kiconloader.h>
-#include <kapplication.h>
+#include <kicon.h>
#include <kdebug.h>
#include <kmessagebox.h>
#include <kaction.h>
@@ -108,8 +127,6 @@
// the famous activating-file-menu-switches-part bug.
w->setFocusPolicy( Qt::ClickFocus );
- // setXMLFile( ... ); // no actions currently
-
// loadPlugins(); // in case we want to allow plugins for this part.
}
--- trunk/KDE/kdelibs/kparts/tests/parts.h #1013871:1013872
@@ -1,4 +1,24 @@
+/*
+ Copyright (c) 1999, 2000 David Faure <faure@kde.org>
+ Copyright (c) 1999, 2000 Simon Hausmann <hausmann@kde.org>
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
#ifndef __parts_h__
#define __parts_h__
** trunk/KDE/kdelibs/kparts/tests/partviewer.cpp #property svn:eol-style
+ native
** trunk/KDE/kdelibs/kparts/tests/partviewer.cpp #property svn:keywords
+ Author Date Id Revision
** trunk/KDE/kdelibs/kparts/tests/partviewer.cpp #property svn:mergeinfo
+
** trunk/KDE/kdelibs/kparts/tests/partviewer.cpp #property svn:mime-type
+ text/x-c++src
** trunk/KDE/kdelibs/kparts/tests/partviewer.h #property svn:eol-style
+ native
** trunk/KDE/kdelibs/kparts/tests/partviewer.h #property svn:keywords
+ Author Date Id Revision
** trunk/KDE/kdelibs/kparts/tests/partviewer.h #property svn:mergeinfo
+
** trunk/KDE/kdelibs/kparts/tests/partviewer.h #property svn:mime-type
+ text/x-chdr
** trunk/KDE/kdelibs/kparts/tests/partviewer_shell.rc #property svn:keywords
+ Author Date Id Revision
** trunk/KDE/kdelibs/kparts/tests/partviewer_shell.rc #property svn:mergeinfo
+
--- trunk/KDE/kdelibs/kparts/tests/plugin_spellcheck.cpp #1013871:1013872
@@ -1,3 +1,23 @@
+/*
+ Copyright (c) 2000 David Faure <faure@kde.org>
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
#include "notepad.h" // this plugin applies to a notepad part
#include <QtGui/QTextEdit>
#include "plugin_spellcheck.h"
@@ -25,13 +45,15 @@
{
kDebug() << "Plugin parent : " << parent()->objectName() << " (" << \
parent()->metaObject()->className() << ")"; // The parent is assumed to be a \
NotepadPart + // Can't use qobject_cast here, we would need NotepadPart to be in a \
shared library. if ( !parent()->inherits("NotepadPart") )
KMessageBox::error(0,"You just called the spell-check action on a wrong part \
(not NotepadPart)"); else
{
NotepadPart * part = (NotepadPart *) parent();
- QTextEdit * widget = (QTextEdit *) part->widget();
- widget->selectAll(); //selects current line !
+ QTextEdit * widget = qobject_cast<QTextEdit *>(part->widget());
+ Q_ASSERT(widget);
+ widget->selectAll();
}
}
--- trunk/KDE/kdelibs/kparts/tests/plugin_spellcheck.h #1013871:1013872
@@ -1,3 +1,23 @@
+/*
+ Copyright (c) 2000 David Faure <faure@kde.org>
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2 of the License or ( at
+ your option ) version 3 or, at the discretion of KDE e.V. ( which shall
+ act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
#ifndef plugin_spellcheck_h
#define plugin_spellcheck_h
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.cpp #property svn:eol-style
+ native
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.cpp #property svn:keywords
+ Author Date Id Revision
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.cpp #property svn:mergeinfo
+
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.cpp #property svn:mime-type
+ text/x-c++src
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.h #property svn:eol-style
+ native
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.h #property svn:keywords
+ Author Date Id Revision
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.h #property svn:mergeinfo
+
** trunk/KDE/kdelibs/kparts/tests/testmainwindow.h #property svn:mime-type
+ text/x-chdr
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic