Commit 45c8faee authored by Albert Astals Cid's avatar Albert Astals Cid

using Part as class name makes it very easy to collide with other Parts out...

using Part as class name makes it very easy to collide with other Parts out there and very ugly things will happen, add a namespace

svn path=/trunk/KDE/kdegraphics/okular/; revision=1040789
parent f074fc2e
......@@ -13,6 +13,9 @@
// local includes
#include "part.h"
namespace Okular
{
/*
* BrowserExtension class
*/
......@@ -114,6 +117,7 @@ void OkularLiveConnectExtension::postMessage( const QStringList &args )
"{ this.messageHandler.onMessage(" + arrayarg + ") }" );
}
}
#include "extensions.moc"
......
......@@ -13,6 +13,9 @@
#include <kparts/browserextension.h>
namespace Okular
{
class Part;
class BrowserExtension : public KParts::BrowserExtension
......@@ -51,6 +54,9 @@ class OkularLiveConnectExtension : public KParts::LiveConnectExtension
bool m_inEval;
QString m_evalRes;
};
}
#endif
/* kate: replace-tabs on; indent-width 4; */
......@@ -143,7 +143,7 @@ class FileKeeper
std::FILE * m_handle;
};
K_PLUGIN_FACTORY( okularPartFactory, registerPlugin< Part >(); )
K_PLUGIN_FACTORY( okularPartFactory, registerPlugin< Okular::Part >(); )
K_EXPORT_PLUGIN( okularPartFactory( okularAboutData( "okular", I18N_NOOP( "Okular" ) ) ) )
static QAction* actionForExportFormat( const Okular::ExportFormat& format, QObject *parent = 0 )
......@@ -183,29 +183,29 @@ static QString compressedMimeFor( const QString& mime_to_check )
return QString();
}
static Part::EmbedMode detectEmbedMode( QWidget *parentWidget, QObject *parent, const QVariantList &args )
static Okular::Part::EmbedMode detectEmbedMode( QWidget *parentWidget, QObject *parent, const QVariantList &args )
{
Q_UNUSED( parentWidget );
if ( parent
&& ( parent->objectName() == QLatin1String( "okular::Shell" )
|| parent->objectName() == QLatin1String( "okular/okular__Shell" ) ) )
return Part::NativeShellMode;
return Okular::Part::NativeShellMode;
if ( parent
&& ( QByteArray( "KHTMLPart" ) == parent->metaObject()->className() ) )
return Part::KHTMLPartMode;
return Okular::Part::KHTMLPartMode;
Q_FOREACH ( const QVariant &arg, args )
{
if ( arg.type() == QVariant::String )
{
if ( arg.toString() == QLatin1String( "Print/Preview" ) )
return Part::PrintPreviewMode;
return Okular::Part::PrintPreviewMode;
}
}
return Part::UnknownEmbedMode;
return Okular::Part::UnknownEmbedMode;
}
#undef OKULAR_KEEP_FILE_OPEN
......@@ -218,6 +218,9 @@ static bool keepFileOpen()
}
#endif
namespace Okular
{
Part::Part(QWidget *parentWidget,
QObject *parent,
const QVariantList &args )
......@@ -2167,6 +2170,7 @@ void Part::updateAboutBackendAction()
}
}
} // namespace Okular
#include "part.moc"
......
......@@ -59,10 +59,9 @@ class BookmarkList;
namespace Okular
{
class ExportFormat;
}
class BrowserExtension;
class ExportFormat;
/**
* This is a "Part". It that does all the real work in a KPart
......@@ -274,6 +273,8 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
void slotGeneratorPreferences();
};
}
#endif
/* kate: replace-tabs on; indent-width 4; */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment