Commit 175803dc authored by Jarosław Staniek's avatar Jarosław Staniek

remove configure option for koproperty (rarely used)

parent bcaf3726
...@@ -526,14 +526,10 @@ set(KOPAGEAPP_INCLUDES ${TEXTLAYOUT_INCLUDES} ...@@ -526,14 +526,10 @@ set(KOPAGEAPP_INCLUDES ${TEXTLAYOUT_INCLUDES}
${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp ) ${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp )
# koproperty # koproperty
SET(KOPROPERTY_TARGETNAME koproperty) # TODO remove when we move to independent place
SET(KOPROPERTY_LIBS ${KOPROPERTY_TARGETNAME}) # TODO remove when we move to independent place
SET(KOPROPERTY_LIB_VERSION ${GENERIC_CALLIGRA_LIB_VERSION}) # TODO remove when we move to independent place
SET(KOPROPERTY_LIB_SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION}) # TODO remove when we move to independent place
SET(KOPROPERTY_USE_KOLIBS TRUE) # TODO remove when we move to independent place
set(KOPROPERTY_INCLUDES ${KOODF_INCLUDES} set(KOPROPERTY_INCLUDES ${KOODF_INCLUDES}
${CMAKE_SOURCE_DIR}/libs ${CMAKE_SOURCE_DIR}/libs
${CMAKE_SOURCE_DIR}/libs/widgets) ${CMAKE_SOURCE_DIR}/libs/widgets)
set(KOPROPERTY_LIBS koproperty)
# calligradb # calligradb
# TODO: remove when Predicate lib arrives # TODO: remove when Predicate lib arrives
......
# The following variables should be set: KOPROPERTY_TARGETNAME, KOPROPERTY_LIBS, KOPROPERTY_LIB_VERSION, KOPROPERTY_LIB_SOVERSION.
# Set KOPROPERTY_USE_KOLIBS to TRUE if extra features that use Calligra libraries should be compiled-in.
# See calligra/kexi/CMakeLists.txt for example.
# TODO remove when we move to independent place
add_subdirectory( test ) add_subdirectory( test )
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=44022) add_definitions(-DKDE_DEFAULT_DEBUG_AREA=44022)
...@@ -26,23 +21,14 @@ set(libkopropertyeditors_SRCS ...@@ -26,23 +21,14 @@ set(libkopropertyeditors_SRCS
editors/sizepolicyedit.cpp editors/sizepolicyedit.cpp
editors/spinbox.cpp editors/spinbox.cpp
editors/stringedit.cpp editors/stringedit.cpp
editors/linestyleedit.cpp
# editors/stringlistedit.cpp # editors/stringlistedit.cpp
# editors/symbolcombo.cpp # editors/symbolcombo.cpp
# editors/timeedit.cpp # editors/timeedit.cpp
# editors/urledit.cpp # editors/urledit.cpp
) )
if(KOPROPERTY_USE_KOLIBS) # TODO remove when we move to independent place include_directories(${KOPROPERTY_INCLUDES})
add_definitions(-DKOPROPERTY_USE_KOLIBS)
include_directories(
${KOPROPERTY_INCLUDES}
)
list(APPEND libkopropertyeditors_SRCS editors/linestyleedit.cpp)
else(KOPROPERTY_USE_KOLIBS)
include_directories(
${KDE4_INCLUDES}
)
endif(KOPROPERTY_USE_KOLIBS)
########### next target ############### ########### next target ###############
...@@ -57,26 +43,17 @@ set(koproperty_LIB_SRCS ...@@ -57,26 +43,17 @@ set(koproperty_LIB_SRCS
${libkopropertyeditors_SRCS} ${libkopropertyeditors_SRCS}
) )
kde4_add_library(koproperty SHARED ${koproperty_LIB_SRCS})
target_link_libraries(koproperty ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} kowidgets)
target_link_libraries(koproperty LINK_INTERFACE_LIBRARIES ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} kowidgets)
kde4_add_library(${KOPROPERTY_TARGETNAME} SHARED ${koproperty_LIB_SRCS}) set_target_properties(koproperty PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION})
install(TARGETS koproperty ${INSTALL_TARGETS_DEFAULT_ARGS})
set(KOPROPERTY_LINK_LIBS ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
if(KOPROPERTY_USE_KOLIBS)
list(APPEND KOPROPERTY_LINK_LIBS kowidgets)
endif(KOPROPERTY_USE_KOLIBS)
target_link_libraries(${KOPROPERTY_TARGETNAME} ${KOPROPERTY_LINK_LIBS})
target_link_libraries(${KOPROPERTY_TARGETNAME} LINK_INTERFACE_LIBRARIES ${KOPROPERTY_LINK_LIBS})
set_target_properties(${KOPROPERTY_TARGETNAME} PROPERTIES VERSION ${KOPROPERTY_LIB_VERSION} SOVERSION ${KOPROPERTY_LIB_SOVERSION} )
install(TARGETS ${KOPROPERTY_TARGETNAME} ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ############### ########### install files ###############
add_definitions(-DKOPROPERTY_APP_DIR="${KOPROPERTY_TARGETNAME}") # for KIconLoader::global()->addAppDir(); kde4_install_icons(${DATA_INSTALL_DIR}/koproperty/icons)
# TODO remove when we move to independent place
kde4_install_icons( ${DATA_INSTALL_DIR}/${KOPROPERTY_TARGETNAME}/icons )
if(FALSE) # TODO: install when we move to independent place if(FALSE) # TODO: install when we move to independent place
install( FILES install( FILES
......
...@@ -38,9 +38,7 @@ ...@@ -38,9 +38,7 @@
#include "editors/sizepolicyedit.h" #include "editors/sizepolicyedit.h"
#include "editors/spinbox.h" #include "editors/spinbox.h"
/*#include "stringlistedit.h"*/ /*#include "stringlistedit.h"*/
#ifdef KOPROPERTY_USE_KOLIBS #include "editors/linestyleedit.h"
# include "editors/linestyleedit.h"
#endif
#include "editors/stringedit.h" #include "editors/stringedit.h"
/*#include "symbolcombo.h" /*#include "symbolcombo.h"
#include "timeedit.h" #include "timeedit.h"
...@@ -60,9 +58,7 @@ DefaultFactory::DefaultFactory() ...@@ -60,9 +58,7 @@ DefaultFactory::DefaultFactory()
addEditor( KoProperty::Double, new DoubleSpinBoxDelegate ); addEditor( KoProperty::Double, new DoubleSpinBoxDelegate );
addEditor( KoProperty::Font, new FontDelegate ); addEditor( KoProperty::Font, new FontDelegate );
addEditor( KoProperty::Int, new IntSpinBoxDelegate ); addEditor( KoProperty::Int, new IntSpinBoxDelegate );
#ifdef KOPROPERTY_USE_KOLIBS
addEditor( KoProperty::LineStyle, new LineStyleComboDelegate ); addEditor( KoProperty::LineStyle, new LineStyleComboDelegate );
#endif
//! @todo addEditor( KoProperty::LongLong, new LongLongSpinBoxDelegate ); //! @todo addEditor( KoProperty::LongLong, new LongLongSpinBoxDelegate );
addEditor( KoProperty::Pixmap, new PixmapDelegate ); addEditor( KoProperty::Pixmap, new PixmapDelegate );
addEditor( KoProperty::Point, new PointDelegate ); addEditor( KoProperty::Point, new PointDelegate );
......
...@@ -131,7 +131,7 @@ using namespace KoProperty; ...@@ -131,7 +131,7 @@ using namespace KoProperty;
Factory::Factory() Factory::Factory()
: d( new Private ) : d( new Private )
{ {
KIconLoader::global()->addAppDir(KOPROPERTY_APP_DIR); KIconLoader::global()->addAppDir("koproperty");
} }
Factory::~Factory() Factory::~Factory()
......
...@@ -37,9 +37,7 @@ ...@@ -37,9 +37,7 @@
#include <QEvent> #include <QEvent>
#include <QLineEdit> #include <QLineEdit>
#ifdef KOPROPERTY_USE_KOLIBS #include <KoUnit.h>
# include <KoUnit.h>
#endif
using namespace KoProperty; using namespace KoProperty;
...@@ -317,22 +315,18 @@ void DoubleSpinBox::resizeEvent( QResizeEvent * event ) ...@@ -317,22 +315,18 @@ void DoubleSpinBox::resizeEvent( QResizeEvent * event )
void DoubleSpinBox::setValue(double v) void DoubleSpinBox::setValue(double v)
{ {
#ifdef KOPROPERTY_USE_KOLIBS
if (!m_unit.isEmpty()) { if (!m_unit.isEmpty()) {
KDoubleNumInput::setValue(KoUnit::fromSymbol(m_unit).toUserValue(v)); KDoubleNumInput::setValue(KoUnit::fromSymbol(m_unit).toUserValue(v));
return; return;
} }
#endif
KDoubleNumInput::setValue(v); KDoubleNumInput::setValue(v);
} }
double DoubleSpinBox::value() const double DoubleSpinBox::value() const
{ {
#ifdef KOPROPERTY_USE_KOLIBS
if (!m_unit.isEmpty()) { if (!m_unit.isEmpty()) {
return KoUnit::fromSymbol(m_unit).fromUserValue(KDoubleNumInput::value()); return KoUnit::fromSymbol(m_unit).fromUserValue(KDoubleNumInput::value());
} }
#endif
return KDoubleNumInput::value(); return KDoubleNumInput::value();
} }
...@@ -543,12 +537,10 @@ QString DoubleSpinBoxDelegate::displayTextForProperty( const Property* prop ) co ...@@ -543,12 +537,10 @@ QString DoubleSpinBoxDelegate::displayTextForProperty( const Property* prop ) co
//! @todo precision? //! @todo precision?
//! @todo rounding using KLocale::formatNumber(const QString &numStr, bool round = true,int precision = 2)? //! @todo rounding using KLocale::formatNumber(const QString &numStr, bool round = true,int precision = 2)?
QString display; QString display;
#ifdef KOPROPERTY_USE_KOLIBS
if (!unit.isEmpty()) { if (!unit.isEmpty()) {
return KGlobal::locale()->formatNumber(KoUnit::fromSymbol(unit).toUserValue(prop->value().toDouble())) + return KGlobal::locale()->formatNumber(KoUnit::fromSymbol(unit).toUserValue(prop->value().toDouble())) +
QLatin1Char(' ') + unit; QLatin1Char(' ') + unit;
} }
#endif
return KGlobal::locale()->formatNumber(prop->value().toDouble()); return KGlobal::locale()->formatNumber(prop->value().toDouble());
} }
......
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