X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=repository.cpp;fp=repository.cpp;h=0b143d40ba17d2f1a3ed2612f7cc1fc669acef57;hb=e21101f3bfe7af2692313c6ad1e402b6c549e1a6;hp=96a3b912fe2c9b3aab2b7a682162a8a2bca59819;hpb=4974259fff67950e07d05b5f42c09502751d85d7;p=fapman diff --git a/repository.cpp b/repository.cpp index 96a3b91..0b143d4 100644 --- a/repository.cpp +++ b/repository.cpp @@ -30,10 +30,10 @@ Repository::~Repository() { } -QString Repository::toString() const +QString Repository::toString(bool noDisable) const { QString str; - if( iEnabled ) + if( iEnabled || noDisable ) str = "deb "; else str = "#deb "; @@ -135,6 +135,26 @@ bool Repository::setFromString(QString repo) return true; } +void Repository::setUrlDir(QString url_dir) +{ + QString url; + QString dir; + + if( url_dir.indexOf("://") == -1 ) + return; + int d = url_dir.indexOf('/', url_dir.indexOf("://")+3 ); + if( d==-1 ) { + url = url_dir; + dir = ""; + } else { + url = url_dir.left(d+1); + dir = url_dir.right( url_dir.length()-d-1 ); + } + + iUrl = url; + iDir = dir; +} + void Repository::set(QString name, QString url_dir, QString dist, QString components, bool enabled) { QString url;