Qalculate

Plasma 5 Add-Ons

Source (link to git-repo or to original if based on someone elses unmodified work): https://github.com/dschopf/qalculate

2
7.3
Description:

A calculator plasma widget which uses the Qalculate! library to provide lots of features like unit calculation or currency conversion.

In order to install this widget the Qalculate! library is required. Get it at http://qalculate.github.io/.

Install instructions:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_LIBDIR=lib -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
make
sudo make install
Last changelog:

v0.6 1 month ago

Changes include:

- support for launching a program from the widget
- fix for not working input history
- fix for wrong currency update timestamp in the option screen

Cherkah

1 month ago

hi,
can you put a link in the ui to get quickly acces to the GTK-UI. ?
e.g. clik on the picture logo will launch the app!
regards

Report

C

dschopf

1 month ago

I'm not sure I fully understand your request. Do you want a button on your task bar which launches the app or do you want a button (or any other clickable object) inside the widget?

Report

Cherkah

1 month ago

a button (or any other clickable object) inside the widget !
sorry for my english...

Report

C

dschopf

1 month ago

I added support for launching an application from the logo in the github repo: https://github.com/dschopf/qalculate
Can you check if this meets your requirements?

Report

Cherkah

1 month ago

great! thank you dschop.

Report

Murz

11 months ago

8 +

Report

xpt

11 months ago

The plasmoid doesn't give me results, only "Error" as result. I don't have errors in the compilation and qalculate-gtk works fine. I search it, but I can't find anything. Could you give any tip?

Report

C

dschopf

11 months ago

It's difficult to guess what the problem might be. Are there any errors when installing the plugin?
Maybe you could open an issue on Github with some more details like which distribution, compiler and KDE version you are using.

Report

xpt

11 months ago

8 +

Report

sombragris

11 months ago

Forgot to add: using libqalculate-2.2.0

Report

sombragris

11 months ago

Nevermind. My fault. Forgot to read the bit where you said that libqalculate 2.5 or higher is required. Thanks!!

Report

C

dschopf

11 months ago

That part about the requirement of libqalculate v2.5 only refers to the new feature of using the two's complement representation for negative numbers. Apart from that the latest version should hopefully work with all (recent) versions of libqalculate (including v2.2).

The error message you receive looks like an ABI incompatibility between libqalculate and the plugin.
If possible please open a bug report on the Github page, which is much better suited to discuss such issues.

Report

sombragris

11 months ago

Cannot build 0.5. The problem appears to be a linking issue:

[100%] Linking CXX shared library libplasmoidplugin.so
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::updateExchangeRates()':
qwrapper.cpp:(.text+0x4af): undefined reference to `Calculator::getExchangeRatesUrl[abi:cxx11](int)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::printResultInBase(MathStructure&, std::pair&)':
qwrapper.cpp:(.text+0x1720): undefined reference to `Calculator::print[abi:cxx11](MathStructure const&, int, PrintOptions const&)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::runCalculation(std::__cxx11::basic_string, std::allocator > const&)':
qwrapper.cpp:(.text+0x1a6a): undefined reference to `Calculator::calculate(MathStructure*, std::__cxx11::basic_string, std::allocator >, int, EvaluationOptions const&, MathStructure*, MathStructure*, bool)'
qwrapper.cpp:(.text+0x1ab8): undefined reference to `Calculator::print[abi:cxx11](MathStructure const&, int, PrintOptions const&)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::worker()':
qwrapper.cpp:(.text+0x23b0): undefined reference to `Calculator::unlocalizeExpression(std::__cxx11::basic_string, std::allocator >, ParseOptions const&) const'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::QWrapper(QObject*)':
qwrapper.cpp:(.text+0x2b66): undefined reference to `Number::set(std::__cxx11::basic_string, std::allocator >, ParseOptions const&)'
qwrapper.cpp:(.text+0x2c5c): undefined reference to `Number::set(std::__cxx11::basic_string, std::allocator >, ParseOptions const&)'
qwrapper.cpp:(.text+0x2d4b): undefined reference to `Number::set(std::__cxx11::basic_string, std::allocator >, ParseOptions const&)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::fileDownloaded(QNetworkReply*)':
qwrapper.cpp:(.text+0x3373): undefined reference to `Calculator::getExchangeRatesFileName[abi:cxx11](int)'
collect2: error: ld returned 1 exit status
make[2]: *** [plugin/CMakeFiles/plasmoidplugin.dir/build.make:115: plugin/libplasmoidplugin.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:188: plugin/CMakeFiles/plasmoidplugin.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Distribution: Slackware64-current
Qt: 5.9.5
Plasma: 5.12.5
Frameworks: 5.46.0
gcc: 7.3

Thanks!

Report

emezeta

1 year ago


If i try to compile v0.3.1 with libqalculate 2.0.0 I got:

machine:~/setups/pkg/qalculate-0.3.1/build$ make

[ 16%] Built target org.kde.plasma.qalculate-metadata-json
[ 33%] Automatic moc for target plasmoidplugin
[ 33%] Built target plasmoidplugin_automoc
[ 50%] Linking CXX shared library libplasmoidplugin.so
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::setDecimalSeparator(QString const&)':
qwrapper.cpp:(.text+0x707): undefined reference to `Calculator::useDecimalPoint(bool)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::getExchangeRatesUpdateTime()':
qwrapper.cpp:(.text+0xa9e): undefined reference to `Calculator::getExchangeRatesTime()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::evaluate(QString const&, bool)':
qwrapper.cpp:(.text+0xee5): undefined reference to `Calculator::abortPrint()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::worker()':
qwrapper.cpp:(.text+0x142b): undefined reference to `MathStructure::isAborted() const'
qwrapper.cpp:(.text+0x1669): undefined reference to `Calculator::startPrintControl(int)'
qwrapper.cpp:(.text+0x170e): undefined reference to `Calculator::printingAborted()'
qwrapper.cpp:(.text+0x1723): undefined reference to `Calculator::stopPrintControl()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::QWrapper(QObject*)':
qwrapper.cpp:(.text+0x1cf5): undefined reference to `Calculator::useDecimalPoint(bool)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::fileDownloaded(QNetworkReply*)':
qwrapper.cpp:(.text+0x23aa): undefined reference to `Calculator::getExchangeRatesTime()'
collect2: error: ld returned 1 exit status
plugin/CMakeFiles/plasmoidplugin.dir/build.make:147: recipe for target 'plugin/libplasmoidplugin.so' failed
make[2]: *** [plugin/libplasmoidplugin.so] Error 1
CMakeFiles/Makefile2:155: recipe for target 'plugin/CMakeFiles/plasmoidplugin.dir/all' failed
make[1]: *** [plugin/CMakeFiles/plasmoidplugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Similar error when try with v0.4.0 libqalculate-2.4.0


Could you give any tip or so?
Thanks!

Report

C

dschopf

1 year ago

This looks like a version conflict. When you use libqalculate 2.0.0 it should not try to link stopPrintControl().
How did you install the libqalculate? Manually or with a package manager? What does the output of the cmake command say.
It should say something like this:
-- Checking for module 'libqalculate>=0.9.8'
-- Found libqalculate, version 2.4.0

Report

emezeta

1 year ago


finally "make install"

~/setups/pkg/qalculate-0.4.0/build$ su -c "make install"
Password:
[ 16%] Built target org.kde.plasma.qalculate-metadata-json
[ 33%] Automatic moc for target plasmoidplugin
[ 33%] Built target plasmoidplugin_automoc
[ 50%] Linking CXX shared library libplasmoidplugin.so
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::updateExchangeRates()':
qwrapper.cpp:(.text+0x4af): undefined reference to `Calculator::getExchangeRatesUrl[abi:cxx11](int)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::getExchangeRatesUpdateTime()':
qwrapper.cpp:(.text+0x60e): undefined reference to `Calculator::getExchangeRatesTime()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::checkReturnState()':
qwrapper.cpp:(.text+0x80c): undefined reference to `Calculator::aborted()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::printResultInBase(int, MathStructure&, QString&)':
qwrapper.cpp:(.text+0xc73): undefined reference to `Calculator::print[abi:cxx11](MathStructure const&, int, PrintOptions const&)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::runCalculation(std::__cxx11::basic_string, std::allocator > const&)':
qwrapper.cpp:(.text+0x145c): undefined reference to `Calculator::print[abi:cxx11](MathStructure const&, int, PrintOptions const&)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::worker()':
qwrapper.cpp:(.text+0x2087): undefined reference to `Calculator::startControl(int)'
qwrapper.cpp:(.text+0x209b): undefined reference to `Calculator::stopControl()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::QWrapper(QObject*)':
qwrapper.cpp:(.text+0x25c8): undefined reference to `Calculator::useDecimalPoint(bool)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::fileDownloaded(QNetworkReply*)':
qwrapper.cpp:(.text+0x2b6b): undefined reference to `Calculator::getExchangeRatesFileName[abi:cxx11](int)'
qwrapper.cpp:(.text+0x2ce2): undefined reference to `Calculator::getExchangeRatesTime()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::setDecimalSeparator(QString const&)':
qwrapper.cpp:(.text+0x261): undefined reference to `Calculator::useDecimalPoint(bool)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `_GLOBAL__sub_I_qwrapper.cpp':
qwrapper.cpp:(.text.startup+0x37b): undefined reference to `Number::Number(long, long, long)'
collect2: error: ld returned 1 exit status
plugin/CMakeFiles/plasmoidplugin.dir/build.make:147: recipe for target 'plugin/libplasmoidplugin.so' failed
make[2]: *** [plugin/libplasmoidplugin.so] Error 1
CMakeFiles/Makefile2:155: recipe for target 'plugin/CMakeFiles/plasmoidplugin.dir/all' failed
make[1]: *** [plugin/CMakeFiles/plasmoidplugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2


Not significative output differences compiling with any of 2.0.0 or 2.4.0 versions of libqalculate for 'make' and 'make install' commands. { references like (.text+0x2c6a) and percent compiling advances as sole differs. ]

Seems opendesktop.org web app

Report

emezeta

1 year ago

limits msg size...

Report

emezeta

1 year ago

There was no bugs in your code. I successfully could built qalculate after some cleaning in my own library instlltion. Thank you for you suport!

Report

emezeta

1 year ago


I built it all from source repositories
I tried qalculate-0.4.0 that time
Compiling any of both 2.0.0 or 2.4.0 libqalculate run smoothly with

./autogen.sh (if needed)
./configure
make
make install (as root)

cmake::

~/setups/pkg/qalculate-0.4.0/build$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_LIBDIR=lib -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29")
-- Found Readline: /usr/include
-- Checking for module 'libqalculate>=0.9.8'
-- Found libqalculate, version 2.0.0 <============ or 2.4.0 instead
-- Configuring done
-- Generating done
-- Build files have been written to: /_path_/setups/pkg/qalculate-0.4.0/build
continu

Report

emezeta

1 year ago


then make::

~/setups/pkg/qalculate-0.4.0/build$ make
Scanning dependencies of target org.kde.plasma.qalculate-metadata-json
[ 16%] Generating org.kde.plasma.qalculate-metadata.json
Unknown property type for key "X-KDE-ParentApp" -> falling back to string
Unknown property type for key "X-Plasma-API" -> falling back to string
Unknown property type for key "X-Plasma-MainScript" -> falling back to string
Unknown property type for key "X-Plasma-RemoteLocation" -> falling back to string
Generated "/_path_/setups/pkg/qalculate-0.4.0/build/org.kde.plasma.qalculate-metadata.json"

[ 16%] Built target org.kde.plasma.qalculate-metadata-json
Scanning dependencies of target plasmoidplugin_automoc
[ 33%] Automatic moc for target plasmoidplugin
Generating moc source plasmoidplugin_automoc.dir/moc_plasmoidplugin_DZ66HZV5Z3E2K4.cpp
Generating moc source plasmoidplugin_automoc.dir/moc_qwrapper_S2JPYLPKINLUVR.cpp
Generating moc compilation plasmoidplugin_automoc.cpp
[ 33%] Built target plasmoidplugin_automoc
Scanning dependencies of target plasmoidplugin
[ 50%] Building CXX object plugin/CMakeFiles/plasmoidplugin.dir/plasmoidplugin.cpp.o
[ 66%] Building CXX object plugin/CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o
[ 83%] Building CXX object plugin/CMakeFiles/plasmoidplugin.dir/plasmoidplugin_automoc.cpp.o
[100%] Linking CXX shared library libplasmoidplugin.so
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::getExchangeRatesUpdateTime()':
qwrapper.cpp:(.text+0x60e): undefined reference to `Calculator::getExchangeRatesTime()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::checkReturnState()':
qwrapper.cpp:(.text+0x80c): undefined reference to `Calculator::aborted()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::printResultInBase(int, MathStructure&, QString&)':
qwrapper.cpp:(.text+0xc3a): undefined reference to `Calculator::print[abi:cxx11](MathStructure const&, int, PrintOptions const&)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::runCalculation(std::__cxx11::basic_string, std::allocator > const&)':
qwrapper.cpp:(.text+0x141c): undefined reference to `Calculator::print[abi:cxx11](MathStructure const&, int, PrintOptions const&)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::worker()':
qwrapper.cpp:(.text+0x2047): undefined reference to `Calculator::startControl(int)'
qwrapper.cpp:(.text+0x205b): undefined reference to `Calculator::stopControl()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::QWrapper(QObject*)':
qwrapper.cpp:(.text+0x2557): undefined reference to `Calculator::useDecimalPoint(bool)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::fileDownloaded(QNetworkReply*)':
qwrapper.cpp:(.text+0x2c6a): undefined reference to `Calculator::getExchangeRatesTime()'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `QWrapper::setDecimalSeparator(QString const&)':
qwrapper.cpp:(.text+0x261): undefined reference to `Calculator::useDecimalPoint(bool)'
CMakeFiles/plasmoidplugin.dir/qwrapper.cpp.o: In function `_GLOBAL__sub_I_qwrapper.cpp':
qwrapper.cpp:(.text.startup+0x33f): undefined reference to `Number::Number(long, long, long)'
collect2: error: ld returned 1 exit status
plugin/CMakeFiles/plasmoidplugin.dir/build.make:147: recipe for target 'plugin/libplasmoidplugin.so' failed
make[2]: *** [plugin/libplasmoidplugin.so] Error 1
CMakeFiles/Makefile2:155: recipe for target 'plugin/CMakeFiles/plasmoidplugin.dir/all' failed
make[1]: *** [plugin/CMakeFiles/plasmoidplugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Report

emezeta

1 year ago

123

Report

sombragris

1 year ago

Usually whenever libqalculate was upgraded, all that I had to do is to recompile the plasmoid. However, after I upgraded libqalculate to 2.0 and recompiling the plasmoid, I was unable to start plasmashell; there was a "malloc(): memory corruption" message even. I was able to get plasmashell starting again after removing the plasmoid.

The moral of the story is, that plasmoid 0.3x and libqalculate 2.0 do not seem to like each other.

Report

C

dschopf

1 year ago

I uploaded a new experimental version to github which should support libqalculate v2.0.0 much better.

https://github.com/dschopf/qalculate/archive/libqalculate-2.0-fix.zip

Report

sombragris

1 year ago

Thank you! I just used qalculate 0.4 and it works like a charm!

Report

C

dschopf

1 year ago

Are you sure this issue is related to the plasmoid? I have upgraded two different machines to libqalculate 2.0 and both are working fine.

You can use "plasmoidviewer --applet org.kde.plasma.qalculate" to run it separately from KDE and see some debug messages in the konsole.

Report

v0.6 1 month ago

Changes include:

- support for launching a program from the widget
- fix for not working input history
- fix for wrong currency update timestamp in the option screen

v0.5 11 months ago

- add context menu for copying the results to the clipboard
- fix issues with applet size in recent KDE versions
- fix issues with image/logo in recent KDE versions
- add support for negative two's complement representation (this feature requires libqalculate v2.5 or later)

v0.4.0 1 year ago

- add support for libqalculate v2.0.0
- change license to MIT
- bump copyright to 2017
- add .clang-format file for C++ plugin and format accordingly

v0.3 1 year ago

New features:
Add support for history, which can be disabled in the options
Bug fixes:
create only a single C++ wrapper object

v0.2.1 2 years ago

fixed compile issues

v0.2 2 years ago

- make icon configurable
- add busy indicator
- make calculations run in background
- require at least libqalculate-0.9.8

12345678910
7
product-maker Murz Jun 14 2018 8 great
+
product-maker xpt Jun 07 2018 8 great
+
product-maker floorek Aug 06 2017 8 great
product-maker sombragris May 10 2017 8 great
product-maker WIP42 Mar 30 2017 8 great
product-maker mzsgmailcom Mar 14 2017 8 great
product-maker obedlink Oct 10 2016 8 great
product-maker Count: 2 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
MIT License
version
0.6
updated Apr 07 2019
added Sep 28 2016
downloads today
4
page views today 6