summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-02-10 23:58:56 (GMT)
committerAleix Pol <aleixpol@kde.org>2015-02-10 23:58:56 (GMT)
commit56ccc3f70f550d71bd87ffbbf4e0e9d1f3c10ad8 (patch)
treee468c480dba39333678000af9c1f7c996b1220e8
parentc3b298e1a51f1a9dac668248166ef59bbd1d8d33 (diff)
Give Anu a hand at porting
Add still missing dependencies Fix some typos on the cmake scripts Give a push to the porting of C++ code, so that Anu can see what kind of changes are needed. CCMAIL: anu22mittal@gmail.com
-rw-r--r--CMakeLists.txt10
-rw-r--r--compoundviewer/CMakeLists.txt6
-rw-r--r--compoundviewer/kalziumglwidget.cpp1
-rw-r--r--compoundviewer/kalziumglwidget.h2
-rw-r--r--libscience/CMakeLists.txt2
-rw-r--r--libscience/chemicaldataobject.cpp2
-rw-r--r--libscience/element.cpp6
-rw-r--r--libscience/spectrum.cpp6
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/calculator/concCalculator.cpp3
-rw-r--r--src/calculator/gasCalculator.cpp6
-rw-r--r--src/calculator/nuclearCalculator.cpp8
-rw-r--r--src/calculator/nuclearCalculator.h2
-rw-r--r--src/tools/moleculeview.cpp4
-rw-r--r--src/tools/obconverter.cpp2
15 files changed, 27 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 450ae76..1eca2f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,8 +4,8 @@ cmake_minimum_required(VERSION 2.8.12)
find_package(ECM 0.0.11 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${OPENBABEL2_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/cmake/modules)
find_package(OpenBabel2 REQUIRED)
-find_package(Qt5 REQUIRED COMPONENTS Widgets)
-find_package(KF5 REQUIRED COMPONENTS CoreAddons Solid Config)
+find_package(Qt5 REQUIRED COMPONENTS Widgets Script Declarative OpenGL)
+find_package(KF5 REQUIRED COMPONENTS CoreAddons Solid Config Archive I18n Parts UnitConversion WidgetsAddons NewStuff KHtml KDELibs4Support)
find_package(KF5DocTools REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(PkgConfig REQUIRED)
@@ -16,10 +16,6 @@ find_package(ECM REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(PkgConfig REQUIRED)
-find_package(Qt4 REQUIRED)
-find_package(KF5Archive REQUIRED)
-find_package(KF5I18n NO_MODULE)
-find_package(KF5Parts NO_MODULE)
find_package(Gettext REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(Avogadro REQUIRED)
@@ -75,7 +71,7 @@ endif (OPENBABEL2_FOUND AND Avogadro_FOUND AND EIGEN3_FOUND)
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(data)
-add_subdirectory(plasmoid)
+# add_subdirectory(plasmoid)
add_subdirectory(libscience)
add_subdirectory(qml)
diff --git a/compoundviewer/CMakeLists.txt b/compoundviewer/CMakeLists.txt
index 63c9139..a2ff9c2 100644
--- a/compoundviewer/CMakeLists.txt
+++ b/compoundviewer/CMakeLists.txt
@@ -1,5 +1,3 @@
-include(${Avogadro_USE_FILE})
-
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/..
${EIGEN3_INCLUDE_DIR}
${OPENBABEL2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/compoundviewer)
@@ -11,14 +9,14 @@ set(compoundviewer_SRCS
#add_subdirectory(widgets)
-add_library(compoundviewer SHARED ${compoundviewer_SRCS})
+add_library(compoundviewer ${compoundviewer_SRCS})
target_link_libraries(compoundviewer avogadro
${OPENBABEL2_LIBRARIES}
KF5::I18n
KF5::WidgetsAddons
KF5::CoreAddons
- Qt5::Core
+ Qt5::OpenGL
${OPENGL_LIBRARIES}
)
diff --git a/compoundviewer/kalziumglwidget.cpp b/compoundviewer/kalziumglwidget.cpp
index c1be5d7..cfa067c 100644
--- a/compoundviewer/kalziumglwidget.cpp
+++ b/compoundviewer/kalziumglwidget.cpp
@@ -167,4 +167,3 @@ void KalziumGLWidget::setQuality(int quality)
invalidateDLs();
GLWidget::update();
}
-//#include "kalziumglwidget.moc"
diff --git a/compoundviewer/kalziumglwidget.h b/compoundviewer/kalziumglwidget.h
index 4dbdbf7..f5608b0 100644
--- a/compoundviewer/kalziumglwidget.h
+++ b/compoundviewer/kalziumglwidget.h
@@ -17,7 +17,7 @@
#include <avogadro/glwidget.h>
-class KalziumGLWidget : public Avogadro::GLWidget
+class Q_DECL_EXPORT KalziumGLWidget : public Avogadro::GLWidget
{
Q_OBJECT
public:
diff --git a/libscience/CMakeLists.txt b/libscience/CMakeLists.txt
index cf7ac6f..ca629df 100644
--- a/libscience/CMakeLists.txt
+++ b/libscience/CMakeLists.txt
@@ -17,7 +17,7 @@ set(science_LIB_SRCS
add_library(science SHARED ${science_LIB_SRCS})
-target_link_libraries(science Qt5::Xml KF5::UnitConversion KF5::WidgetsAddons)
+target_link_libraries(science Qt5::OpenGL Qt5::Xml KF5::UnitConversion KF5::WidgetsAddons KF5::KDELibs4Support)
set_target_properties(science PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install(TARGETS science ${INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/libscience/chemicaldataobject.cpp b/libscience/chemicaldataobject.cpp
index 8fac92c..687e7f6 100644
--- a/libscience/chemicaldataobject.cpp
+++ b/libscience/chemicaldataobject.cpp
@@ -176,5 +176,5 @@ void ChemicalDataObject::setType(int type)
QString ChemicalDataObject::unitAsString() const
{
- return KUnitConversion::Converter().unit(d->m_unit).data()->symbol();
+ return KUnitConversion::Converter().unit(KUnitConversion::UnitId(d->m_unit)).symbol();
}
diff --git a/libscience/element.cpp b/libscience/element.cpp
index 762462f..8b8cd4e 100644
--- a/libscience/element.cpp
+++ b/libscience/element.cpp
@@ -44,8 +44,8 @@ QVariant Element::dataAsVariant(ChemicalDataObject::BlueObelisk type, int unit)
if (unit == KUnitConversion::NoUnit) {
return o.value();
}
- KUnitConversion::Value data(o.value().toDouble(), o.unit());
- return QVariant(data.convertTo(unit).number());
+ KUnitConversion::Value data(o.value().toDouble(), KUnitConversion::UnitId(o.unit()));
+ return QVariant(data.convertTo(KUnitConversion::UnitId(unit)).number());
}
}
return QVariant();
@@ -70,7 +70,7 @@ QString Element::dataAsStringWithUnit(ChemicalDataObject::BlueObelisk type, int
}
valueAndUnit.append(" ");
- valueAndUnit.append(KUnitConversion::Converter().unit(unit).data()->symbol());
+ valueAndUnit.append(KUnitConversion::Converter().unit(KUnitConversion::UnitId(unit)).symbol());
return valueAndUnit;
}
diff --git a/libscience/spectrum.cpp b/libscience/spectrum.cpp
index 9ce97a5..d0bd385 100644
--- a/libscience/spectrum.cpp
+++ b/libscience/spectrum.cpp
@@ -40,7 +40,7 @@ double Spectrum::minPeak()
double Spectrum::minPeak(const int unit)
{
- return KUnitConversion::Value(minPeak(), KUnitConversion::Angstrom).convertTo(unit).number();
+ return KUnitConversion::Value(minPeak(), KUnitConversion::Angstrom).convertTo(KUnitConversion::UnitId(unit)).number();
}
@@ -59,7 +59,7 @@ double Spectrum::maxPeak()
double Spectrum::maxPeak(const int unit)
{
- return KUnitConversion::Value(maxPeak(), KUnitConversion::Angstrom).convertTo(unit).number();
+ return KUnitConversion::Value(maxPeak(), KUnitConversion::Angstrom).convertTo(KUnitConversion::UnitId(unit)).number();
}
@@ -130,5 +130,5 @@ Spectrum::Spectrum()
double Spectrum::peak::wavelengthToUnit(const int unit)
{
- return KUnitConversion::Value(wavelength, KUnitConversion::Angstrom).convertTo(unit).number();
+ return KUnitConversion::Value(wavelength, KUnitConversion::Angstrom).convertTo(KUnitConversion::UnitId(unit)).number();
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e9cd72c..8cd0107 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,6 +6,8 @@ include_directories(
psetable
isotopetable
${CMAKE_CURRENT_BINARY_DIR}/..
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
)
########### next target ###############
@@ -25,7 +27,7 @@ if (OPENBABEL2_FOUND)
if (EIGEN3_FOUND AND Avogadro_FOUND)
- include(${Avogadro_USE_FILE})
+ #include(${Avogadro_USE_FILE})
set(kalziumtools_SRCS
${kalziumtools_SRCS}
@@ -133,7 +135,7 @@ kconfig_add_kcfg_files(kalzium_SRCS prefs.kcfgc )
add_executable(kalzium ${kalzium_SRCS})
-target_link_libraries(kalzium KDE5::KHTML KF5::KDELibs4Support KDE5::NewStuff KDE4_KUNITCONVERSION_LIBS Qt5::Script Qt5::Declarative science ${OPENBABEL2_LIBRARIES})
+target_link_libraries(kalzium KF5::KHtml KF5::KDELibs4Support KF5::NewStuff KF5::UnitConversion Qt5::Script Qt5::Declarative science ${OPENBABEL2_LIBRARIES})
#QT_QTSCRIPT_LIBRARY
if (OPENBABEL2_FOUND)
target_link_libraries(kalzium ${OPENBABEL2_LIBRARIES})
diff --git a/src/calculator/concCalculator.cpp b/src/calculator/concCalculator.cpp
index 785e77a..23896f4 100644
--- a/src/calculator/concCalculator.cpp
+++ b/src/calculator/concCalculator.cpp
@@ -24,6 +24,7 @@
#include "kalziumutils.h"
#include <kunitconversion/converter.h>
#include "prefs.h"
+#include <klocalizedstring.h>
using namespace KUnitConversion;
@@ -995,5 +996,3 @@ void concCalculator::error(int mode)
break;
}
}
-
-#include "concCalculator.moc"
diff --git a/src/calculator/gasCalculator.cpp b/src/calculator/gasCalculator.cpp
index adef7f5..1a7459c 100644
--- a/src/calculator/gasCalculator.cpp
+++ b/src/calculator/gasCalculator.cpp
@@ -143,7 +143,7 @@ void gasCalculator::calculatePressure()
double pressure = m_moles * R * temp / (volume - m_moles * b) - m_moles * m_moles * m_Vand_a / volume / volume;
m_pressure = Value(pressure, KUnitConversion::Atmosphere);
- m_pressure = m_pressure.convertTo(getCurrentUnitId(ui.pressure_unit));
+ m_pressure = m_pressure.convertTo(getCurrentUnitId(KUnitConversion::UnitId(ui.pressure_unit)));
ui.pressure->setValue(m_pressure.number());
}
@@ -168,7 +168,7 @@ void gasCalculator::calculateVol()
double volume = m_moles * R * temp / pressure + (m_moles * b);
m_vol = Value(volume, KUnitConversion::Liter);
- m_vol = m_vol.convertTo(getCurrentUnitId(ui.volume_unit));
+ m_vol = m_vol.convertTo(getCurrentUnitId(KUnitConversion::UnitId(ui.volume_unit)));
ui.volume->setValue(m_vol.number());
}
@@ -336,5 +336,3 @@ void gasCalculator::error(int mode)
break;
}
}
-
-#include "gasCalculator.moc"
diff --git a/src/calculator/nuclearCalculator.cpp b/src/calculator/nuclearCalculator.cpp
index 488bd38..94bed45 100644
--- a/src/calculator/nuclearCalculator.cpp
+++ b/src/calculator/nuclearCalculator.cpp
@@ -230,7 +230,7 @@ void nuclearCalculator::isotopeChanged(int index)
if (x >= 0) {
ui.halfLife_unit->setCurrentIndex(x);
}
- m_halfLife = Value(halfLife, halfLifeUnit);
+ m_halfLife = Value(halfLife, KUnitConversion::UnitId(halfLifeUnit));
// Recalculate and update
calculate();
}
@@ -244,9 +244,9 @@ void nuclearCalculator::halfLifeChanged()
calculate();
}
-int nuclearCalculator::getUnitIdFromCombobox(QComboBox *comboBox)
+KUnitConversion::UnitId nuclearCalculator::getUnitIdFromCombobox(QComboBox *comboBox)
{
- return comboBox->itemData(comboBox->currentIndex()).toInt();
+ return KUnitConversion::UnitId(comboBox->itemData(comboBox->currentIndex()).toInt());
}
void nuclearCalculator::initAmtChanged()
@@ -448,5 +448,3 @@ void nuclearCalculator::error(int mode)
break;
}
}
-
-#include "nuclearCalculator.moc"
diff --git a/src/calculator/nuclearCalculator.h b/src/calculator/nuclearCalculator.h
index f0230f8..c61780a 100644
--- a/src/calculator/nuclearCalculator.h
+++ b/src/calculator/nuclearCalculator.h
@@ -101,7 +101,7 @@ public slots:
void massUnitCombobox(QComboBox *comboBox);
/// Fetch the active unit id (KUnitConversion) from the combobox
- int getUnitIdFromCombobox(QComboBox *comboBox);
+ KUnitConversion::UnitId getUnitIdFromCombobox(QComboBox *comboBox);
/*
* This function is called when the slider in the ui is moved
diff --git a/src/tools/moleculeview.cpp b/src/tools/moleculeview.cpp
index 7a6c9f3..2476f8b 100644
--- a/src/tools/moleculeview.cpp
+++ b/src/tools/moleculeview.cpp
@@ -28,6 +28,8 @@
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <KLocale>
+#include <KUrl>
+#include <KGlobal>
#include <knewstuff3/downloaddialog.h>
#include <kio/job.h>
@@ -464,5 +466,3 @@ void MoleculeDialog::slotGeometryOptimize()
molecule->update();
}
}
-
-#include "moleculeview.moc"
diff --git a/src/tools/obconverter.cpp b/src/tools/obconverter.cpp
index 04b557d..3be18ab 100644
--- a/src/tools/obconverter.cpp
+++ b/src/tools/obconverter.cpp
@@ -242,5 +242,3 @@ void KOpenBabel::addFile(const QString &filename)
{
ui.FileListView->addItem(filename);
}
-
-#include "obconverter.moc"