Commit 3999dd06 authored by Aard's avatar Aard

[features] Add proto for featuremanager

parent 9146fb36
......@@ -13,7 +13,8 @@ public_headers = \
HEADERS = \
$${public_headers} \
sandbox_p.h \
ssucoreconfig.h
ssucoreconfig.h \
ssufeaturemanager.h
SOURCES = \
sandbox.cpp \
......
/**
* @file ssufeaturemanager.h
* @copyright 2013 Jolla Ltd.
* @author Bernd Wachter <bwachter@lart.info>
* @date 2013
*/
#ifndef _SSUFEATUREMANAGER_H
#define _SSUFEATUREMANAGER_H
#include <QObject>
#include <QHash>
#include <QStringList>
#include "ssusettings.h"
class SsuFeatureManager: public QObject {
Q_OBJECT
public:
SsuFeatureManager(){};
// add rnd-flag?
QStringList repos(){};
QString url(QString repo){ return ""; };
private:
SsuSettings *featureSettings;
};
#endif
......@@ -15,6 +15,7 @@
#include "ssusettings.h"
#include "ssulog.h"
#include "ssuvariables.h"
#include "ssufeaturemanager.h"
#include "ssu.h"
#include "../constants.h"
......@@ -111,6 +112,7 @@ QStringList SsuRepoManager::repos(bool rnd, int filter){
return repos(rnd, deviceInfo, filter);
}
// @todo the non-device specific repository resolving should move from deviceInfo to repomanager
QStringList SsuRepoManager::repos(bool rnd, SsuDeviceInfo &deviceInfo, int filter){
QStringList result;
result = deviceInfo.repos(rnd, filter);
......@@ -314,8 +316,17 @@ QString SsuRepoManager::url(QString repoName, bool rndRepo,
i++;
}
// search for URLs for repositories. Lookup order is:
// 1. overrides in ssu.ini
// 2. URLs from features
// 3. URLs from repos.ini
SsuFeatureManager featureManager;
if (settings->contains("repository-urls/" + repoName))
r = settings->value("repository-urls/" + repoName).toString();
else if (featureManager.url(repoName) != "")
r = featureManager.url(repoName);
else {
foreach (const QString &section, configSections){
repoSettings.beginGroup(section);
......
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