From dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:21 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- kparts/tests/ghostview.cpp | 119 --------------------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 kparts/tests/ghostview.cpp (limited to 'kparts/tests/ghostview.cpp') diff --git a/kparts/tests/ghostview.cpp b/kparts/tests/ghostview.cpp deleted file mode 100644 index 5d1bbe5b3..000000000 --- a/kparts/tests/ghostview.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "ghostview.h" - -Shell::Shell() -{ - setXMLFile( "ghostviewtest_shell.rc" ); - - KAction * paOpen = new KAction( "&Open file" , "fileopen", 0, this, - TQT_SLOT( slotFileOpen() ), actionCollection(), "file_open" ); - - KAction * paQuit = new KAction( "&Quit" , "exit", 0, this, TQT_SLOT( close() ), actionCollection(), "file_quit" ); - - // Try to find a postscript component first - KTrader::OfferList offers = KTrader::self()->query("application/postscript", "('KParts/ReadOnlyPart' in ServiceTypes) or ('Browser/View' in ServiceTypes)"); - - KLibFactory *factory = 0; - m_gvpart = 0; - KTrader::OfferList::Iterator it(offers.begin()); - for( ; it != offers.end(); ++it) - { - KService::Ptr ptr = (*it); - - factory = KLibLoader::self()->factory( TQFile::encodeName(ptr->library()) ); - if (factory) - { - m_gvpart = static_cast(factory->create(this, ptr->name().latin1(), "KParts::ReadOnlyPart")); - setCentralWidget( m_gvpart->widget() ); - // Integrate its GUI - createGUI( m_gvpart ); - - break; - } - } - - // if we couldn't find a component with the trader, try the - // kghostview library directly. if this ever happens, then something - // is seriously screwed up, though -- the kghostview component - // should be picked up by the trader - if (!m_gvpart) - { - factory = KLibLoader::self()->factory( "libkghostview" ); - if (factory) - { - // Create the part - m_gvpart = (KParts::ReadOnlyPart *)factory->create( this, "kgvpart", - "KParts::ReadOnlyPart" ); - // Set the main widget - setCentralWidget( m_gvpart->widget() ); - // Integrate its GUI - createGUI( m_gvpart ); - } - else - { - KMessageBox::error(this, "No libkghostview found !"); - } - } - // Set a reasonable size - resize( 600, 350 ); -} - -Shell::~Shell() -{ - delete m_gvpart; -} - -void Shell::openURL( const KURL & url ) -{ - m_gvpart->openURL( url ); -} - -void Shell::slotFileOpen() -{ - KURL url = KFileDialog::getOpenURL( TQString::null, "*.ps|Postscript files (*.ps)", 0L, "file dialog" ); - - if( !url.isEmpty() ) - openURL( url ); -} - -static KCmdLineOptions options[] = -{ - { "+file(s)", "Files to load", 0 }, - KCmdLineLastOption -}; -static const char version[] = "v0.0.1 2000 (c) David Faure"; -static const char description[] = "This is a test shell for the kghostview part."; - -int main( int argc, char **argv ) -{ - TDECmdLineArgs::init(argc, argv, "ghostviewtest", description, version); - TDECmdLineArgs::addCmdLineOptions( options ); // Add my own options. - TDEApplication app; - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - Shell *shell = new Shell; - if ( args->count() == 1 ) - { - // Allow full paths, but also simple filenames from current dir - KURL url( TQDir::currentDirPath()+"/", args->arg(0) ); - shell->openURL( url ); - } - shell->show(); - return app.exec(); -} - -#include "ghostview.moc" -- cgit v1.2.1