Skip to content

Commit

Permalink
Merge pull request #106 from MyHush/denio
Browse files Browse the repository at this point in the history
Some improvements and updates
  • Loading branch information
DenioD authored Apr 12, 2020
2 parents 42cc400 + a073ae9 commit 3d2abd1
Show file tree
Hide file tree
Showing 15 changed files with 1,637 additions and 1,587 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ silentdragonlite.pro.user.4.10-pre1
silentdragonlite
silentdragonlite_plugin_import.cpp
silentdragonlite_resource.rc
SilentDragonLite
82 changes: 41 additions & 41 deletions lib/Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ crate-type = ["staticlib"]
[dependencies]
libc = "0.2.58"
lazy_static = "1.4.0"
silentdragonlitelib = { git = "https://github.com/MyHush/silentdragonlite-cli", rev = "44f64181143be9b3747b54580943017b85d93cd7" }
silentdragonlitelib = { git = "https://github.com/MyHush/silentdragonlite-cli", rev = "7efa024660cbe08e7eadf2524134e153c89c51ad" }
Binary file modified res/silentdragonlite_es.qm
Binary file not shown.
730 changes: 369 additions & 361 deletions res/silentdragonlite_es.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion silentdragon-lite.pro
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ TRANSLATIONS = res/silentdragonlite_es.ts \
res/silentdragonlite_tr.ts

include(singleapplication/singleapplication.pri)
DEFINES += QAPPLICATION_CLASS=QApplication
DEFINES += QAPPLICATION_CLASS=QApplication _FORTIFY_SOURCE=2

QMAKE_INFO_PLIST = res/Info.plist

Expand Down
58 changes: 58 additions & 0 deletions src/DataStore.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#ifndef DATASTORE_H
#define DATASTORE_H

#include <QString>
#include <map>

template <class T>
class DataStore
{
private:
static bool instanced;
static DataStore<T>* instance;
std::map<QString, T> data;
DataStore()
{

}

public:
static DataStore<T>* getInstance()
{
if(!DataStore<T>::instanced)
{
DataStore<T>::instanced = true;
DataStore<T>::instance = new DataStore<T>();
}

return DataStore<T>::instance;
}

void clear();
void setData(QString key, T value);
QString getData(QString key);

~DataStore()
{
DataStore<T>::instanced = false;
}
};

template <class T>
void DataStore<T>::clear()
{
this->data.clear();
}

template <class T>
void DataStore<T>::setData(QString key, T value)
{
this->data[key] = value;
}

template <class T>
QString DataStore<T>::getData(QString key)
{
return this->data[key];
}
#endif
Loading

0 comments on commit 3d2abd1

Please sign in to comment.