|
Lines 28-34
Link Here
|
| 28 |
#include <tdeio/job.h> |
28 |
#include <tdeio/job.h> |
| 29 |
#include <tdefileitem.h> |
29 |
#include <tdefileitem.h> |
| 30 |
#include <tdeversion.h> |
30 |
#include <tdeversion.h> |
| 31 |
#include <knewstuff/entry.h> |
31 |
#include <tdenewstuff/entry.h> |
| 32 |
#include <kstandarddirs.h> |
32 |
#include <kstandarddirs.h> |
| 33 |
|
33 |
|
| 34 |
#include <tqfileinfo.h> |
34 |
#include <tqfileinfo.h> |
|
Lines 94-100
bool Manager::installTemplate(const KURL& url_, const TQString& entryName_) {
Link Here
|
| 94 |
} else { |
94 |
} else { |
| 95 |
// remove ".xsl" |
95 |
// remove ".xsl" |
| 96 |
xslFile.truncate(xslFile.length()-4); |
96 |
xslFile.truncate(xslFile.length()-4); |
| 97 |
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffFiles"); |
97 |
TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffFiles"); |
| 98 |
config.writeEntry(xslFile, allFiles); |
98 |
config.writeEntry(xslFile, allFiles); |
| 99 |
m_urlNameMap.insert(url_, xslFile); |
99 |
m_urlNameMap.insert(url_, xslFile); |
| 100 |
} |
100 |
} |
|
Lines 106-112
bool Manager::installTemplate(const KURL& url_, const TQString& entryName_) {
Link Here
|
| 106 |
} |
106 |
} |
| 107 |
|
107 |
|
| 108 |
bool Manager::removeTemplate(const TQString& name_) { |
108 |
bool Manager::removeTemplate(const TQString& name_) { |
| 109 |
TDEConfigGroup fileGroup(TDEGlobal::config(), "KNewStuffFiles"); |
109 |
TDEConfigGroup fileGroup(TDEGlobal::config(), "TDENewStuffFiles"); |
| 110 |
TQStringList files = fileGroup.readListEntry(name_); |
110 |
TQStringList files = fileGroup.readListEntry(name_); |
| 111 |
// at least, delete xsl file |
111 |
// at least, delete xsl file |
| 112 |
if(files.isEmpty()) { |
112 |
if(files.isEmpty()) { |
|
Lines 130-136
bool Manager::removeTemplate(const TQString& name_) {
Link Here
|
| 130 |
|
130 |
|
| 131 |
// remove config entries even if unsuccessful |
131 |
// remove config entries even if unsuccessful |
| 132 |
fileGroup.deleteEntry(name_); |
132 |
fileGroup.deleteEntry(name_); |
| 133 |
TDEConfigGroup statusGroup(TDEGlobal::config(), "KNewStuffStatus"); |
133 |
TDEConfigGroup statusGroup(TDEGlobal::config(), "TDENewStuffStatus"); |
| 134 |
TQString entryName = statusGroup.readEntry(name_); |
134 |
TQString entryName = statusGroup.readEntry(name_); |
| 135 |
statusGroup.deleteEntry(name_); |
135 |
statusGroup.deleteEntry(name_); |
| 136 |
statusGroup.deleteEntry(entryName); |
136 |
statusGroup.deleteEntry(entryName); |
|
Lines 209-215
bool Manager::installScript(const KURL& url_) {
Link Here
|
| 209 |
} |
209 |
} |
| 210 |
|
210 |
|
| 211 |
{ |
211 |
{ |
| 212 |
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffFiles"); |
212 |
TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffFiles"); |
| 213 |
config.writeEntry(info->sourceName, archiveFiles(archiveDir)); |
213 |
config.writeEntry(info->sourceName, archiveFiles(archiveDir)); |
| 214 |
m_urlNameMap.insert(url_, info->sourceName); |
214 |
m_urlNameMap.insert(url_, info->sourceName); |
| 215 |
} |
215 |
} |
|
Lines 225-231
bool Manager::installScript(const KURL& url_) {
Link Here
|
| 225 |
} |
225 |
} |
| 226 |
|
226 |
|
| 227 |
bool Manager::removeScript(const TQString& name_) { |
227 |
bool Manager::removeScript(const TQString& name_) { |
| 228 |
TDEConfigGroup fileGroup(TDEGlobal::config(), "KNewStuffFiles"); |
228 |
TDEConfigGroup fileGroup(TDEGlobal::config(), "TDENewStuffFiles"); |
| 229 |
TQStringList files = fileGroup.readListEntry(name_); |
229 |
TQStringList files = fileGroup.readListEntry(name_); |
| 230 |
|
230 |
|
| 231 |
bool success = true; |
231 |
bool success = true; |
|
Lines 244-250
bool Manager::removeScript(const TQString& name_) {
Link Here
|
| 244 |
|
244 |
|
| 245 |
// remove config entries even if unsuccessful |
245 |
// remove config entries even if unsuccessful |
| 246 |
fileGroup.deleteEntry(name_); |
246 |
fileGroup.deleteEntry(name_); |
| 247 |
TDEConfigGroup statusGroup(TDEGlobal::config(), "KNewStuffStatus"); |
247 |
TDEConfigGroup statusGroup(TDEGlobal::config(), "TDENewStuffStatus"); |
| 248 |
TQString entryName = statusGroup.readEntry(name_); |
248 |
TQString entryName = statusGroup.readEntry(name_); |
| 249 |
statusGroup.deleteEntry(name_); |
249 |
statusGroup.deleteEntry(name_); |
| 250 |
statusGroup.deleteEntry(entryName); |
250 |
statusGroup.deleteEntry(entryName); |
|
Lines 253-259
bool Manager::removeScript(const TQString& name_) {
Link Here
|
| 253 |
} |
253 |
} |
| 254 |
|
254 |
|
| 255 |
Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) { |
255 |
Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) { |
| 256 |
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffStatus"); |
256 |
TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffStatus"); |
| 257 |
TQString datestring = config.readEntry(entry_->name()); |
257 |
TQString datestring = config.readEntry(entry_->name()); |
| 258 |
if(datestring.isEmpty()) { |
258 |
if(datestring.isEmpty()) { |
| 259 |
return NotInstalled; |
259 |
return NotInstalled; |
|
Lines 268-274
Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) {
Link Here
|
| 268 |
} |
268 |
} |
| 269 |
|
269 |
|
| 270 |
// also check that executable files exists |
270 |
// also check that executable files exists |
| 271 |
TDEConfigGroup fileGroup(TDEGlobal::config(), "KNewStuffFiles"); |
271 |
TDEConfigGroup fileGroup(TDEGlobal::config(), "TDENewStuffFiles"); |
| 272 |
TQStringList files = fileGroup.readListEntry(entry_->name()); |
272 |
TQStringList files = fileGroup.readListEntry(entry_->name()); |
| 273 |
TQString path = Tellico::saveLocation(TQString::fromLatin1("data-sources/")); |
273 |
TQString path = Tellico::saveLocation(TQString::fromLatin1("data-sources/")); |
| 274 |
for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { |
274 |
for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { |
|
Lines 394-400
void Manager::slotInstallFinished() {
Link Here
|
| 394 |
if(newScript && newScript->successfulInstall()) { |
394 |
if(newScript && newScript->successfulInstall()) { |
| 395 |
const TQString name = m_urlNameMap[newScript->url()]; |
395 |
const TQString name = m_urlNameMap[newScript->url()]; |
| 396 |
KNS::Entry* entry = m_scriptEntryMap[newScript]; |
396 |
KNS::Entry* entry = m_scriptEntryMap[newScript]; |
| 397 |
TDEConfigGroup config(TDEGlobal::config(), "KNewStuffStatus"); |
397 |
TDEConfigGroup config(TDEGlobal::config(), "TDENewStuffStatus"); |
| 398 |
// have to keep a config entry that maps the name of the file to the name |
398 |
// have to keep a config entry that maps the name of the file to the name |
| 399 |
// of the newstuff entry, so we can track which entries are installed |
399 |
// of the newstuff entry, so we can track which entries are installed |
| 400 |
// name and entry-name() are probably the same for scripts, but not a problem |
400 |
// name and entry-name() are probably the same for scripts, but not a problem |