|
Lines 30-42
Link Here
|
| 30 |
/** RepoInfo implementation. */ |
30 |
/** RepoInfo implementation. */ |
| 31 |
struct RepoInfo::Impl |
31 |
struct RepoInfo::Impl |
| 32 |
{ |
32 |
{ |
|
|
33 |
enum FlagsDeterminedState |
| 34 |
{ |
| 35 |
FLAG_ENABLED = 1, |
| 36 |
FLAG_AUTOREFRESH = 2, |
| 37 |
FLAG_GPGCHECK = 4, |
| 38 |
FLAG_KEEPPACKAGES = 8 |
| 39 |
}; |
| 33 |
|
40 |
|
| 34 |
Impl() |
41 |
Impl() |
| 35 |
: enabled (false), |
42 |
: enabled (false), |
| 36 |
autorefresh(false), |
43 |
autorefresh(false), |
| 37 |
gpgcheck(true), |
44 |
gpgcheck(true), |
| 38 |
keeppackages(false), |
45 |
keeppackages(false), |
| 39 |
type(repo::RepoType::NONE_e) |
46 |
type(repo::RepoType::NONE_e), |
|
|
47 |
flags_determined(0) |
| 40 |
{} |
48 |
{} |
| 41 |
|
49 |
|
| 42 |
~Impl() |
50 |
~Impl() |
|
Lines 73-78
Link Here
|
| 73 |
Pathname metadatapath; |
81 |
Pathname metadatapath; |
| 74 |
Pathname packagespath; |
82 |
Pathname packagespath; |
| 75 |
DefaultIntegral<unsigned,defaultPriority> priority; |
83 |
DefaultIntegral<unsigned,defaultPriority> priority; |
|
|
84 |
int flags_determined; |
| 76 |
public: |
85 |
public: |
| 77 |
|
86 |
|
| 78 |
private: |
87 |
private: |
|
Lines 128-145
Link Here
|
| 128 |
RepoInfo & RepoInfo::setEnabled( bool enabled ) |
137 |
RepoInfo & RepoInfo::setEnabled( bool enabled ) |
| 129 |
{ |
138 |
{ |
| 130 |
_pimpl->enabled = enabled; |
139 |
_pimpl->enabled = enabled; |
|
|
140 |
_pimpl->flags_determined |= Impl::FLAG_ENABLED; |
| 131 |
return *this; |
141 |
return *this; |
| 132 |
} |
142 |
} |
| 133 |
|
143 |
|
| 134 |
RepoInfo & RepoInfo::setAutorefresh( bool autorefresh ) |
144 |
RepoInfo & RepoInfo::setAutorefresh( bool autorefresh ) |
| 135 |
{ |
145 |
{ |
| 136 |
_pimpl->autorefresh = autorefresh; |
146 |
_pimpl->autorefresh = autorefresh; |
|
|
147 |
_pimpl->flags_determined |= Impl::FLAG_AUTOREFRESH; |
| 137 |
return *this; |
148 |
return *this; |
| 138 |
} |
149 |
} |
| 139 |
|
150 |
|
| 140 |
RepoInfo & RepoInfo::setGpgCheck( bool check ) |
151 |
RepoInfo & RepoInfo::setGpgCheck( bool check ) |
| 141 |
{ |
152 |
{ |
| 142 |
_pimpl->gpgcheck = check; |
153 |
_pimpl->gpgcheck = check; |
|
|
154 |
_pimpl->flags_determined |= Impl::FLAG_GPGCHECK; |
| 143 |
return *this; |
155 |
return *this; |
| 144 |
} |
156 |
} |
| 145 |
|
157 |
|
|
Lines 157-163
Link Here
|
| 157 |
|
169 |
|
| 158 |
RepoInfo & RepoInfo::addBaseUrl( const Url &url ) |
170 |
RepoInfo & RepoInfo::addBaseUrl( const Url &url ) |
| 159 |
{ |
171 |
{ |
| 160 |
if ( _pimpl->baseUrls.size()==0 ) //first url |
172 |
// set only if not already set (bnc #394728) |
|
|
173 |
if (!(_pimpl->flags_determined & Impl::FLAG_KEEPPACKAGES)) |
| 161 |
{ |
174 |
{ |
| 162 |
if ( media::MediaAccess::downloads( url ) ) |
175 |
if ( media::MediaAccess::downloads( url ) ) |
| 163 |
setKeepPackages(true); |
176 |
setKeepPackages(true); |
|
Lines 235-240
Link Here
|
| 235 |
RepoInfo & RepoInfo::setKeepPackages( bool keep ) |
248 |
RepoInfo & RepoInfo::setKeepPackages( bool keep ) |
| 236 |
{ |
249 |
{ |
| 237 |
_pimpl->keeppackages = keep; |
250 |
_pimpl->keeppackages = keep; |
|
|
251 |
_pimpl->flags_determined |= Impl::FLAG_KEEPPACKAGES; |
| 238 |
return *this; |
252 |
return *this; |
| 239 |
} |
253 |
} |
| 240 |
|
254 |
|