| 17 | #endif |
| 18 | |
| 19 | Plugin::Plugin(QString name, QString path, QObject *parent) : |
| 20 | QObject(parent) |
| 21 | { |
| 22 | DEBUG_LOW_LEVEL << Q_FUNC_INFO << name << path; |
| 23 | _pathPlugin = path; |
| 24 | QDir pluginPath(_pathPlugin); |
| 25 | |
| 26 | QString fileName = path+"/"+name+".ini"; |
| 27 | QSettings settings( fileName, QSettings::IniFormat ); |
| 28 | settings.beginGroup("Main"); |
| 29 | this->_name = settings.value( "Name", "Error").toString(); |
| 30 | if (settings.contains(kOsSpecificExecuteKey)) { |
| 31 | this->_exec = settings.value( kOsSpecificExecuteKey, "").toString(); |
| 32 | } else { |
| 33 | this->_exec = settings.value( "Execute", "").toString(); |
| 34 | } |
| 35 | this->_guid = settings.value( "Guid", "").toString(); |
| 36 | this->_author = settings.value( "Author", "").toString(); |
| 37 | this->_description = settings.value( "Description", "").toString(); |
| 38 | this->_version = settings.value( "Version", "").toString(); |
| 39 | this->_icon = pluginPath.absoluteFilePath(settings.value( "Icon", "").toString()); |
| 40 | settings.endGroup(); |
| 41 | |
| 42 | process = new QProcess(this); |
| 43 | |
| 44 | } |
| 45 | |
| 46 | Plugin::~Plugin() |
| 47 | { |