mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 18:32:51 +00:00
generic: misc cleanups and adjustments
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
aaa9d1cf48
commit
2cf532fa19
20 changed files with 24 additions and 40 deletions
|
@ -2,17 +2,13 @@ project (kde-playground)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
|
||||||
|
|
||||||
set(QT_MIN_VERSION "4.8.2")
|
find_package(KDE4 4.18.0 REQUIRED)
|
||||||
find_package(KDE4 4.14.3 REQUIRED)
|
|
||||||
include(KDE4Defaults)
|
include(KDE4Defaults)
|
||||||
include(GenerateExportHeader)
|
|
||||||
|
|
||||||
set(LIBRARY_TYPE SHARED)
|
set(LIBRARY_TYPE SHARED)
|
||||||
|
|
||||||
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||||
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
|
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${KDE4_INCLUDES})
|
|
||||||
|
|
||||||
macro_optional_add_subdirectory (kdbg)
|
macro_optional_add_subdirectory (kdbg)
|
||||||
macro_optional_add_subdirectory (pykde4)
|
macro_optional_add_subdirectory (pykde4)
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <KInputDialog>
|
#include <KInputDialog>
|
||||||
#include <kio/deletejob.h>
|
#include <kio/deletejob.h>
|
||||||
#include <KMenu>
|
#include <KMenu>
|
||||||
#include <KMenuBar>
|
#include <QMenuBar>
|
||||||
#include <KRecentFilesAction>
|
#include <KRecentFilesAction>
|
||||||
#include <KShortcutsDialog>
|
#include <KShortcutsDialog>
|
||||||
#include <KStatusNotifierItem>
|
#include <KStatusNotifierItem>
|
||||||
|
@ -149,7 +149,7 @@ MainWindow::MainWindow()
|
||||||
{
|
{
|
||||||
// menu structure
|
// menu structure
|
||||||
|
|
||||||
KMenuBar *menuBar = KMainWindow::menuBar();
|
QMenuBar *menuBar = KMainWindow::menuBar();
|
||||||
collection = new KActionCollection(this);
|
collection = new KActionCollection(this);
|
||||||
|
|
||||||
KMenu *menu = new KMenu(i18n("&File"), this);
|
KMenu *menu = new KMenu(i18n("&File"), this);
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
#include <KGenericFactory>
|
|
||||||
#include <KConfig>
|
#include <KConfig>
|
||||||
#include <KAction>
|
#include <KAction>
|
||||||
#include <KIcon>
|
#include <KIcon>
|
||||||
|
|
|
@ -58,7 +58,7 @@ using namespace KIO;
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
KDE_EXPORT int kdemain(int argc, char **argv);
|
Q_DECL_EXPORT int kdemain(int argc, char **argv);
|
||||||
|
|
||||||
#ifdef HAVE_GPHOTO2_5
|
#ifdef HAVE_GPHOTO2_5
|
||||||
static void frontendCameraStatus(GPContext *context, const char *status, void *data);
|
static void frontendCameraStatus(GPContext *context, const char *status, void *data);
|
||||||
|
|
|
@ -14,7 +14,7 @@ set(core_SRCS
|
||||||
utils.cpp
|
utils.cpp
|
||||||
logger.cpp
|
logger.cpp
|
||||||
config.cpp
|
config.cpp
|
||||||
globalconfig.cpp )
|
globalconfig.cpp
|
||||||
|
)
|
||||||
|
|
||||||
qt4_automoc(${core_SRCS})
|
|
||||||
add_library(core STATIC ${core_SRCS})
|
add_library(core STATIC ${core_SRCS})
|
||||||
|
|
|
@ -28,8 +28,8 @@ set(libviews_SRCS
|
||||||
coverageitem.cpp
|
coverageitem.cpp
|
||||||
sourceitem.cpp
|
sourceitem.cpp
|
||||||
instritem.cpp
|
instritem.cpp
|
||||||
partlistitem.cpp )
|
partlistitem.cpp
|
||||||
|
)
|
||||||
|
|
||||||
qt4_automoc(${libviews_SRCS})
|
|
||||||
add_library(views STATIC ${libviews_SRCS})
|
add_library(views STATIC ${libviews_SRCS})
|
||||||
target_link_libraries(views core)
|
target_link_libraries(views core)
|
||||||
|
|
|
@ -4,7 +4,6 @@ set(qcachegrind_SRCS qcgmain.cpp qcgtoplevel.cpp qcgconfig.cpp
|
||||||
configdialog.cpp configpage.cpp qtcolorbutton.cpp
|
configdialog.cpp configpage.cpp qtcolorbutton.cpp
|
||||||
generalsettings.cpp sourcesettings.cpp colorsettings.cpp)
|
generalsettings.cpp sourcesettings.cpp colorsettings.cpp)
|
||||||
|
|
||||||
qt4_automoc(${qcachegrind_SRCS})
|
|
||||||
qt4_wrap_ui(qcachegrind_H generalsettings.ui sourcesettings.ui colorsettings.ui)
|
qt4_wrap_ui(qcachegrind_H generalsettings.ui sourcesettings.ui colorsettings.ui)
|
||||||
qt4_add_resources(qcachegrind_RSRC qcachegrind.qrc)
|
qt4_add_resources(qcachegrind_RSRC qcachegrind.qrc)
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,6 @@ add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||||
|
|
||||||
include(KDE4Defaults)
|
include(KDE4Defaults)
|
||||||
include(MacroLibrary)
|
include(MacroLibrary)
|
||||||
#include(ManualStuff.cmake)
|
|
||||||
#include(ConfigureChecks.cmake)
|
|
||||||
|
|
||||||
add_subdirectory(kdbg)
|
add_subdirectory(kdbg)
|
||||||
add_subdirectory(po)
|
add_subdirectory(po)
|
||||||
|
|
|
@ -4,6 +4,7 @@ add_subdirectory(typetables)
|
||||||
|
|
||||||
include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
|
include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
|
include(CheckIncludeFiles)
|
||||||
|
|
||||||
CHECK_INCLUDE_FILES(pty.h HAVE_PTY_H)
|
CHECK_INCLUDE_FILES(pty.h HAVE_PTY_H)
|
||||||
CHECK_INCLUDE_FILES(libutil.h HAVE_LIBUTIL_H)
|
CHECK_INCLUDE_FILES(libutil.h HAVE_LIBUTIL_H)
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <kcodecs.h> // KMD5
|
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <klocale.h> /* i18n */
|
#include <klocale.h> /* i18n */
|
||||||
#include <kmessagebox.h>
|
#include <kmessagebox.h>
|
||||||
|
@ -677,7 +676,7 @@ QString KDebugger::getConfigForExe(const QString& name)
|
||||||
// a hash of the directory, followed by the program name.
|
// a hash of the directory, followed by the program name.
|
||||||
// Assume that the first 15 positions of the hash are unique;
|
// Assume that the first 15 positions of the hash are unique;
|
||||||
// this keeps the file names short.
|
// this keeps the file names short.
|
||||||
QString hash = KMD5(dir.toUtf8()).base64Digest();
|
QString hash = dir.toUtf8().toBase64();
|
||||||
hash.replace('/', QString()); // avoid directory separators
|
hash.replace('/', QString()); // avoid directory separators
|
||||||
QString pgmConfigFile = hash.left(15) + "-" + fi.fileName();
|
QString pgmConfigFile = hash.left(15) + "-" + fi.fileName();
|
||||||
pgmConfigFile = KStandardDirs::locateLocal("sessions", pgmConfigFile);
|
pgmConfigFile = KStandardDirs::locateLocal("sessions", pgmConfigFile);
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
#include <KCmdLineArgs>
|
#include <KCmdLineArgs>
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <KLocale>
|
#include <KLocale>
|
||||||
|
#include <kdeversion.h>
|
||||||
|
|
||||||
using namespace KHC;
|
using namespace KHC;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ int Application::newInstance()
|
||||||
int main( int argc, char **argv )
|
int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
KAboutData aboutData( "khelpcenter", 0, ki18n("KDE Help Center"),
|
KAboutData aboutData( "khelpcenter", 0, ki18n("KDE Help Center"),
|
||||||
HELPCENTER_VERSION,
|
KDE_VERSION_STRING,
|
||||||
ki18n("The KDE Help Center"),
|
ki18n("The KDE Help Center"),
|
||||||
KAboutData::License_GPL,
|
KAboutData::License_GPL,
|
||||||
ki18n("(c) 1999-2011, The KHelpCenter developers") );
|
ki18n("(c) 1999-2011, The KHelpCenter developers") );
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace KHC {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" { int KDE_EXPORT kdemain(int argc, char **argv); }
|
extern "C" { int Q_DECL_EXPORT kdemain(int argc, char **argv); }
|
||||||
|
|
||||||
#endif // KHC_APPLICATION_H
|
#endif // KHC_APPLICATION_H
|
||||||
// vim:ts=2:sw=2:et
|
// vim:ts=2:sw=2:et
|
||||||
|
|
|
@ -256,7 +256,7 @@ bool DocEntry::docExists() const
|
||||||
if ( !mUrl.isEmpty() )
|
if ( !mUrl.isEmpty() )
|
||||||
{
|
{
|
||||||
KUrl docUrl( mUrl );
|
KUrl docUrl( mUrl );
|
||||||
if ( docUrl.isLocalFile() && !KStandardDirs::exists( docUrl.toLocalFile() ) )
|
if ( docUrl.isLocalFile() && !KGlobal::dirs()->exists( docUrl.toLocalFile() ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ void HTMLSearch::scanDir(const QString& dir)
|
||||||
|
|
||||||
QStringList::ConstIterator it;
|
QStringList::ConstIterator it;
|
||||||
|
|
||||||
if ( KStandardDirs::exists( dir + "index.docbook" ) ) {
|
if ( KGlobal::dirs()->exists( dir + "index.docbook" ) ) {
|
||||||
_files.append(dir + "index.docbook");
|
_files.append(dir + "index.docbook");
|
||||||
progress->setFilesScanned(++_filesScanned);
|
progress->setFilesScanned(++_filesScanned);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -628,7 +628,8 @@ void KCMHelpCenter::slotReceivedStdout()
|
||||||
mStdOut.append( text );
|
mStdOut.append( text );
|
||||||
} else {
|
} else {
|
||||||
if ( mProgressDialog ) {
|
if ( mProgressDialog ) {
|
||||||
mProgressDialog->appendLog( mStdOut + text.left( pos ) );
|
QByteArray logtext = mStdOut + text.left( pos );
|
||||||
|
mProgressDialog->appendLog( logtext );
|
||||||
mStdOut = text.mid( pos + 1 );
|
mStdOut = text.mid( pos + 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
#include "khc_indexbuilder.h"
|
#include "khc_indexbuilder.h"
|
||||||
|
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <KLocale>
|
#include <KLocale>
|
||||||
#include <KCmdLineArgs>
|
#include <KCmdLineArgs>
|
||||||
|
@ -31,6 +29,7 @@
|
||||||
#include <KProcess>
|
#include <KProcess>
|
||||||
#include <KConfig>
|
#include <KConfig>
|
||||||
#include <KShell>
|
#include <KShell>
|
||||||
|
#include <kdeversion.h>
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
@ -152,7 +151,7 @@ int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
KAboutData aboutData( "khc_indexbuilder", 0,
|
KAboutData aboutData( "khc_indexbuilder", 0,
|
||||||
ki18n("KHelpCenter Index Builder"),
|
ki18n("KHelpCenter Index Builder"),
|
||||||
HELPCENTER_VERSION,
|
KDE_VERSION_STRING,
|
||||||
ki18n("The KDE Help Center"),
|
ki18n("The KDE Help Center"),
|
||||||
KAboutData::License_GPL,
|
KAboutData::License_GPL,
|
||||||
ki18n("(c) 2003, The KHelpCenter developers") );
|
ki18n("(c) 2003, The KHelpCenter developers") );
|
||||||
|
|
|
@ -232,7 +232,7 @@ void HelpProtocol::get( const KUrl& url )
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QString docbook_file = file.left(file.lastIndexOf('/')) + "/index.docbook";
|
QString docbook_file = file.left(file.lastIndexOf('/')) + "/index.docbook";
|
||||||
if (!KStandardDirs::exists(file)) {
|
if (!KGlobal::dirs()->exists(file)) {
|
||||||
file = docbook_file;
|
file = docbook_file;
|
||||||
} else {
|
} else {
|
||||||
QFileInfo fi(file);
|
QFileInfo fi(file);
|
||||||
|
|
|
@ -33,7 +33,7 @@ extern "C" int xmlLoadExtDtdDefaultValue;
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
KDE_EXPORT int kdemain( int argc, char **argv )
|
Q_DECL_EXPORT int kdemain( int argc, char **argv )
|
||||||
{
|
{
|
||||||
Q_ASSERT(!KGlobal::hasMainComponent()); // kdeinit is messed up if this is the case.
|
Q_ASSERT(!KGlobal::hasMainComponent()); // kdeinit is messed up if this is the case.
|
||||||
KComponentData componentData( "kio_help", "kio_help4" );
|
KComponentData componentData( "kio_help", "kio_help4" );
|
||||||
|
|
|
@ -115,7 +115,7 @@ xmlParserInputPtr meinExternalEntityLoader(const char *URL, const char *ID,
|
||||||
URL = "docbook/xml-dtd-4.1.2/docbookx.dtd";
|
URL = "docbook/xml-dtd-4.1.2/docbookx.dtd";
|
||||||
|
|
||||||
QString file;
|
QString file;
|
||||||
if (KStandardDirs::exists( QDir::currentPath() + "/" + URL ) )
|
if (KGlobal::dirs()->exists( QDir::currentPath() + "/" + URL ) )
|
||||||
file = QDir::currentPath() + "/" + URL;
|
file = QDir::currentPath() + "/" + URL;
|
||||||
else
|
else
|
||||||
file = locate("dtd", URL);
|
file = locate("dtd", URL);
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
|
|
||||||
#ifndef KHC_VERSION_H
|
|
||||||
#define KHC_VERSION_H
|
|
||||||
|
|
||||||
#define HELPCENTER_VERSION KDE_VERSION_STRING
|
|
||||||
|
|
||||||
#endif // KHC_VERSION_H
|
|
||||||
// vim:ts=2:sw=2:et
|
|
Loading…
Add table
Reference in a new issue