2005-05-12 12:15:44 +00:00
|
|
|
// -*- indent-tabs-mode:nil -*-
|
2003-10-06 18:31:25 +00:00
|
|
|
// vim: set ts=4 sts=4 sw=4 et:
|
2003-01-21 16:16:53 +00:00
|
|
|
/* This file is part of the KDE project
|
|
|
|
Copyright (C) 2000 David Faure <faure@kde.org>
|
|
|
|
Copyright (C) 2002-2003 Alexander Kellett <lypanov@kde.org>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public
|
|
|
|
License version 2 as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2003-10-11 13:45:28 +00:00
|
|
|
General Public License for more details.
|
2003-01-21 16:16:53 +00:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; see the file COPYING. If not, write to
|
2005-10-05 08:44:32 +00:00
|
|
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
2005-07-04 19:02:09 +00:00
|
|
|
Boston, MA 02110-1301, USA.
|
2003-01-21 16:16:53 +00:00
|
|
|
*/
|
|
|
|
|
2003-09-14 18:07:31 +00:00
|
|
|
#include "toplevel.h"
|
|
|
|
#include "testlink.h"
|
2004-06-23 15:56:06 +00:00
|
|
|
#include "commands.h"
|
2003-09-14 18:07:31 +00:00
|
|
|
#include "bookmarkiterator.h"
|
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
#include <qtimer.h>
|
|
|
|
#include <qpainter.h>
|
|
|
|
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
|
|
|
#include <krfcdate.h>
|
|
|
|
#include <kcharsets.h>
|
|
|
|
#include <kbookmarkmanager.h>
|
|
|
|
|
|
|
|
#include <kaction.h>
|
2005-08-13 20:13:21 +00:00
|
|
|
#include <klocale.h>
|
2003-01-21 16:16:53 +00:00
|
|
|
|
|
|
|
TestLinkItrHolder *TestLinkItrHolder::s_self = 0;
|
|
|
|
|
|
|
|
TestLinkItrHolder::TestLinkItrHolder()
|
2003-10-11 13:45:28 +00:00
|
|
|
: BookmarkIteratorHolder() {
|
|
|
|
// do stuff
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-02-06 09:59:59 +00:00
|
|
|
void TestLinkItrHolder::doItrListChanged() {
|
2003-10-11 13:45:28 +00:00
|
|
|
KEBApp::self()->setCancelTestsEnabled(count() > 0);
|
2005-06-15 14:41:18 +00:00
|
|
|
if(count() == 0)
|
|
|
|
{
|
|
|
|
kdDebug()<<"Notifing managers "<<m_affectedBookmark<<endl;
|
|
|
|
CurrentMgr::self()->notifyManagers(CurrentMgr::bookmarkAt(m_affectedBookmark).toGroup());
|
2006-01-02 17:28:18 +00:00
|
|
|
m_affectedBookmark.clear();
|
2005-06-15 14:41:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestLinkItrHolder::addAffectedBookmark( const QString & address )
|
|
|
|
{
|
|
|
|
kdDebug()<<"addAffectedBookmark "<<address<<endl;
|
|
|
|
if(m_affectedBookmark.isNull())
|
|
|
|
m_affectedBookmark = address;
|
|
|
|
else
|
|
|
|
m_affectedBookmark = KBookmark::commonParent(m_affectedBookmark, address);
|
|
|
|
kdDebug()<<" m_affectedBookmark is now "<<m_affectedBookmark<<endl;
|
2003-02-06 09:59:59 +00:00
|
|
|
}
|
|
|
|
|
2003-02-16 00:05:39 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
|
2005-09-28 16:16:52 +00:00
|
|
|
TestLinkItr::TestLinkItr(QList<KBookmark> bks)
|
2003-10-11 13:45:28 +00:00
|
|
|
: BookmarkIterator(bks) {
|
|
|
|
m_job = 0;
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TestLinkItr::~TestLinkItr() {
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME set status
|
2003-10-11 13:45:28 +00:00
|
|
|
if (m_job) {
|
2003-11-03 10:33:23 +00:00
|
|
|
// kdDebug() << "JOB kill\n";
|
2003-10-11 13:45:28 +00:00
|
|
|
m_job->disconnect();
|
|
|
|
m_job->kill(false);
|
|
|
|
}
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-03-08 13:22:06 +00:00
|
|
|
bool TestLinkItr::isApplicable(const KBookmark &bk) const {
|
2003-10-11 13:45:28 +00:00
|
|
|
return (!bk.isGroup() && !bk.isSeparator());
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-03-03 20:52:39 +00:00
|
|
|
void TestLinkItr::doAction() {
|
2003-10-11 13:45:28 +00:00
|
|
|
m_errSet = false;
|
2003-03-08 15:54:58 +00:00
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
m_job = KIO::get(curBk().url(), true, false);
|
|
|
|
m_job->addMetaData("errorPage", "true");
|
2005-07-04 22:50:02 +00:00
|
|
|
m_job->addMetaData( QString("cookies"), QString("none") );
|
2003-03-08 15:54:58 +00:00
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
connect(m_job, SIGNAL( result( KIO::Job *)),
|
|
|
|
this, SLOT( slotJobResult(KIO::Job *)));
|
|
|
|
connect(m_job, SIGNAL( data( KIO::Job *, const QByteArray &)),
|
|
|
|
this, SLOT( slotJobData(KIO::Job *, const QByteArray &)));
|
2003-03-08 15:54:58 +00:00
|
|
|
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->setTmpStatus(i18n("Checking..."));
|
2003-10-11 13:45:28 +00:00
|
|
|
QString oldModDate = TestLinkItrHolder::self()->getMod(curBk().url().url());
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->setOldStatus(oldModDate);
|
2003-10-11 13:45:28 +00:00
|
|
|
TestLinkItrHolder::self()->setMod(curBk().url().url(), i18n("Checking..."));
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestLinkItr::slotJobData(KIO::Job *job, const QByteArray &data) {
|
2003-10-11 13:45:28 +00:00
|
|
|
KIO::TransferJob *transfer = (KIO::TransferJob *)job;
|
|
|
|
|
|
|
|
if (transfer->isErrorPage()) {
|
|
|
|
QStringList lines = QStringList::split('\n', data);
|
|
|
|
for (QStringList::Iterator it = lines.begin(); it != lines.end(); ++it) {
|
|
|
|
int open_pos = (*it).find("<title>", 0, false);
|
|
|
|
if (open_pos >= 0) {
|
|
|
|
QString leftover = (*it).mid(open_pos + 7);
|
2005-09-24 12:02:49 +00:00
|
|
|
int close_pos = leftover.lastIndexOf( "</title>", -1, Qt::CaseInsensitive );
|
2003-10-11 13:45:28 +00:00
|
|
|
if (close_pos >= 0) {
|
|
|
|
// if no end tag found then just
|
|
|
|
// print the first line of the <title>
|
|
|
|
leftover = leftover.left(close_pos);
|
|
|
|
}
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->nsPut(KCharsets::resolveEntities(leftover));
|
2003-10-11 13:45:28 +00:00
|
|
|
m_errSet = true;
|
|
|
|
break;
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
2003-10-11 13:45:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
QString modDate = transfer->queryMetaData("modified");
|
|
|
|
if (!modDate.isEmpty()) {
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->nsPut(QString::number(KRFCDate::parseDate(modDate)));
|
2003-10-11 13:45:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
transfer->kill(false);
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestLinkItr::slotJobResult(KIO::Job *job) {
|
2003-10-11 13:45:28 +00:00
|
|
|
m_job = 0;
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME if ( !curItem() ) return;
|
2003-10-11 13:45:28 +00:00
|
|
|
|
|
|
|
KIO::TransferJob *transfer = (KIO::TransferJob *)job;
|
|
|
|
QString modDate = transfer->queryMetaData("modified");
|
|
|
|
|
|
|
|
bool chkErr = true;
|
|
|
|
if (transfer->error()) {
|
|
|
|
// can we assume that errorString will contain no entities?
|
|
|
|
QString jerr = job->errorString();
|
|
|
|
if (!jerr.isEmpty()) {
|
|
|
|
jerr.replace("\n", " ");
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->nsPut(jerr);
|
2003-10-11 13:45:28 +00:00
|
|
|
chkErr = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (chkErr) {
|
|
|
|
if (!modDate.isEmpty()) {
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->nsPut(QString::number(KRFCDate::parseDate(modDate)));
|
2003-10-11 13:45:28 +00:00
|
|
|
} else if (!m_errSet) {
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->nsPut(QString::number(KRFCDate::parseDate("0")));
|
2003-10-11 13:45:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME curItem()->modUpdate();
|
2005-06-15 14:41:18 +00:00
|
|
|
holder()->addAffectedBookmark(KBookmark::parentAddress(curBk().address()));
|
2003-10-11 13:45:28 +00:00
|
|
|
delayedEmitNextOne();
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-02-16 00:05:39 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
|
2003-03-08 15:54:58 +00:00
|
|
|
const QString TestLinkItrHolder::getMod(const QString &url) const {
|
2003-10-11 13:45:28 +00:00
|
|
|
return m_modify.contains(url)
|
2003-03-08 16:25:54 +00:00
|
|
|
? m_modify[url]
|
2006-01-02 17:28:18 +00:00
|
|
|
: QString();
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2004-06-23 15:56:06 +00:00
|
|
|
const QString TestLinkItrHolder::getOldVisit(const QString &url) const {
|
2003-10-11 13:45:28 +00:00
|
|
|
return self()->m_oldModify.contains(url)
|
2003-01-21 16:16:53 +00:00
|
|
|
? self()->m_oldModify[url]
|
2006-01-02 17:28:18 +00:00
|
|
|
: QString();
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-02-27 23:31:16 +00:00
|
|
|
void TestLinkItrHolder::setMod(const QString &url, const QString &val) {
|
2003-10-11 13:45:28 +00:00
|
|
|
m_modify[url] = val;
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2004-06-23 15:56:06 +00:00
|
|
|
void TestLinkItrHolder::setOldVisit(const QString &url, const QString &val) {
|
2003-10-11 13:45:28 +00:00
|
|
|
m_oldModify[url] = val;
|
2003-03-08 16:25:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestLinkItrHolder::resetToValue(const QString &url, const QString &oldValue) {
|
2003-10-11 13:45:28 +00:00
|
|
|
if (!oldValue.isEmpty()) {
|
|
|
|
m_modify[url] = oldValue;
|
|
|
|
} else {
|
|
|
|
m_modify.remove(url);
|
|
|
|
}
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-02-16 00:05:39 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
|
2005-08-13 20:13:21 +00:00
|
|
|
/*
|
2004-06-23 15:56:06 +00:00
|
|
|
QString TestLinkItrHolder::calcPaintStyle(const QString &url, KEBListViewItem::PaintStyle &_style,
|
|
|
|
const QString &nVisit, const QString &Modify) {
|
2003-10-11 13:45:28 +00:00
|
|
|
bool newModValid = false;
|
|
|
|
int newMod = 0;
|
2004-06-23 15:56:06 +00:00
|
|
|
QString newModStr;
|
|
|
|
bool initial = false;
|
|
|
|
bool oldError = false;
|
|
|
|
|
|
|
|
if (!Modify.isNull() && Modify == "1") {
|
|
|
|
oldError = true;
|
|
|
|
}
|
2003-10-11 13:45:28 +00:00
|
|
|
|
2004-06-24 14:56:03 +00:00
|
|
|
// get new mod time if there is one
|
2004-06-23 15:56:06 +00:00
|
|
|
newModStr = self()->getMod(url);
|
|
|
|
|
2004-06-24 14:56:03 +00:00
|
|
|
// if no new mod time use previous one
|
2004-06-23 15:56:06 +00:00
|
|
|
if (newModStr.isNull()) {
|
|
|
|
newModStr = Modify;
|
|
|
|
initial = true;
|
|
|
|
}
|
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
if (!newModStr.isNull()) {
|
|
|
|
newMod = newModStr.toInt(&newModValid);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-06-30 13:29:57 +00:00
|
|
|
// kdDebug() << "TestLink " << url << " " << "booktime=" << nVisit << " urltime=" << newModStr <<
|
2004-06-23 15:56:06 +00:00
|
|
|
// " Modify=" << Modify << " init=" << initial << " newMod=" << newMod << "\n";
|
|
|
|
|
|
|
|
QString visitStr;
|
|
|
|
|
|
|
|
if (self()->getOldVisit(url).isNull()) {
|
2003-10-11 13:45:28 +00:00
|
|
|
// first time
|
2004-06-23 15:56:06 +00:00
|
|
|
visitStr = nVisit;
|
|
|
|
if (!nVisit.isEmpty())
|
|
|
|
self()->setOldVisit(url, visitStr);
|
2004-07-14 15:20:39 +00:00
|
|
|
} else {
|
2003-10-11 13:45:28 +00:00
|
|
|
// may be reading a second bookmark with same url
|
2004-06-23 15:56:06 +00:00
|
|
|
QString oom = nVisit;
|
|
|
|
visitStr = self()->getOldVisit(url);
|
|
|
|
if (oom.toInt() > visitStr.toInt()) {
|
|
|
|
self()->setOldVisit(url, oom);
|
|
|
|
visitStr = oom;
|
2003-10-11 13:45:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-23 15:56:06 +00:00
|
|
|
int visit = 0;
|
|
|
|
if (!visitStr.isNull())
|
|
|
|
visit = visitStr.toInt(); // TODO - check validity?
|
2003-10-11 13:45:28 +00:00
|
|
|
|
|
|
|
QString statusStr;
|
|
|
|
KEBListViewItem::PaintStyle style = KEBListViewItem::DefaultStyle;
|
|
|
|
|
2004-06-30 13:29:57 +00:00
|
|
|
// kdDebug() << "TestLink " << "isNull=" << newModStr.isNull() << "newModValid="
|
|
|
|
// << newModValid << "newMod > visit " << newMod << ">" << visit << "\n";
|
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
if (!newModStr.isNull() && !newModValid) {
|
2004-06-24 14:56:03 +00:00
|
|
|
// Current check has error
|
2003-10-11 13:45:28 +00:00
|
|
|
statusStr = newModStr;
|
2004-06-24 14:56:03 +00:00
|
|
|
if (oldError) {
|
|
|
|
style = KEBListViewItem::BoldStyle;
|
|
|
|
} else {
|
|
|
|
style = KEBListViewItem::DefaultStyle;
|
|
|
|
}
|
2004-06-23 15:56:06 +00:00
|
|
|
|
|
|
|
} else if (initial && oldError) {
|
2004-06-24 14:56:03 +00:00
|
|
|
// Previous check has error
|
2004-06-23 15:56:06 +00:00
|
|
|
style = KEBListViewItem::GreyStyle;
|
2004-06-24 14:56:03 +00:00
|
|
|
statusStr = i18n("Error ");
|
2004-06-23 15:56:06 +00:00
|
|
|
|
2004-06-24 14:56:03 +00:00
|
|
|
} else if (!initial && !newModStr.isNull() && (newMod == 0)) {
|
|
|
|
// Current check has no modify time
|
2003-10-11 13:45:28 +00:00
|
|
|
statusStr = i18n("Ok");
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2004-06-24 14:56:03 +00:00
|
|
|
} else if (initial && !newModStr.isNull() && (newMod == 0)) {
|
|
|
|
// previous check has no modify time recorded
|
2006-01-02 17:28:18 +00:00
|
|
|
statusStr.clear();
|
2004-06-24 14:56:03 +00:00
|
|
|
|
2004-06-23 15:56:06 +00:00
|
|
|
} else if (!newModStr.isNull() && (newMod > visit)) {
|
|
|
|
// if modify time greater than last visit, show bold modify time
|
2005-06-17 16:26:03 +00:00
|
|
|
statusStr = CurrentMgr::makeTimeStr(newMod);
|
2004-06-23 15:56:06 +00:00
|
|
|
if (initial) {
|
|
|
|
style = KEBListViewItem::GreyBoldStyle;
|
|
|
|
} else {
|
|
|
|
style = KEBListViewItem::BoldStyle;
|
|
|
|
}
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2004-06-23 15:56:06 +00:00
|
|
|
} else if (visit != 0) {
|
|
|
|
// modify time not greater than last visit, show last visit time
|
2005-06-17 16:26:03 +00:00
|
|
|
statusStr = CurrentMgr::makeTimeStr(visit);
|
2004-06-23 15:56:06 +00:00
|
|
|
if (initial) {
|
|
|
|
style = KEBListViewItem::GreyStyle;
|
|
|
|
} else {
|
|
|
|
style = KEBListViewItem::DefaultStyle;
|
|
|
|
}
|
2003-03-08 13:46:31 +00:00
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
} else {
|
2006-01-02 17:28:18 +00:00
|
|
|
statusStr.clear();
|
2003-10-11 13:45:28 +00:00
|
|
|
}
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
_style = style;
|
|
|
|
return statusStr;
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
2005-08-13 20:13:21 +00:00
|
|
|
*/
|
|
|
|
/*
|
2004-06-23 15:56:06 +00:00
|
|
|
static void parseInfo (KBookmark &bk, QString &nVisited) {
|
|
|
|
nVisited =
|
|
|
|
NodeEditCommand::getNodeText(bk, QStringList() << "info" << "metadata"
|
|
|
|
<< "time_visited" );
|
|
|
|
|
|
|
|
// kdDebug() << " Visited=" << nVisited << "\n";
|
|
|
|
}
|
2005-08-13 20:13:21 +00:00
|
|
|
*/
|
2004-06-23 15:56:06 +00:00
|
|
|
|
2003-02-27 23:31:16 +00:00
|
|
|
static void parseNsInfo(const QString &nsinfo, QString &nCreate, QString &nAccess, QString &nModify) {
|
2003-10-11 13:45:28 +00:00
|
|
|
QStringList sl = QStringList::split(' ', nsinfo);
|
|
|
|
|
|
|
|
for (QStringList::Iterator it = sl.begin(); it != sl.end(); ++it) {
|
|
|
|
QStringList spl = QStringList::split('"', (*it));
|
|
|
|
|
|
|
|
if (spl[0] == "LAST_MODIFIED=") {
|
|
|
|
nModify = spl[1];
|
|
|
|
} else if (spl[0] == "ADD_DATE=") {
|
|
|
|
nCreate = spl[1];
|
|
|
|
} else if (spl[0] == "LAST_VISIT=") {
|
|
|
|
nAccess = spl[1];
|
|
|
|
}
|
|
|
|
}
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2004-06-24 14:56:03 +00:00
|
|
|
// Still use nsinfo for storing old modify time
|
2003-03-08 16:25:54 +00:00
|
|
|
static const QString updateNsInfoMod(const QString &_nsinfo, const QString &nm) {
|
2003-10-11 13:45:28 +00:00
|
|
|
QString nCreate, nAccess, nModify;
|
|
|
|
parseNsInfo(_nsinfo, nCreate, nAccess, nModify);
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
bool numValid = false;
|
|
|
|
nm.toInt(&numValid);
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
QString tmp;
|
|
|
|
tmp = "ADD_DATE=\"" + ((nCreate.isEmpty()) ? QString::number(time(0)) : nCreate) + "\"";
|
2004-05-13 22:16:15 +00:00
|
|
|
tmp += " LAST_VISIT=\"" + ((nAccess.isEmpty()) ? QString("0") : nAccess) + "\"";
|
|
|
|
tmp += " LAST_MODIFIED=\"" + ((numValid) ? nm : QString("1")) + "\"";
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2004-06-23 15:56:06 +00:00
|
|
|
// if (!numValid) kdDebug() << tmp << "\n";
|
2003-10-11 13:45:28 +00:00
|
|
|
return tmp;
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-10-19 15:00:07 +00:00
|
|
|
// KEBListViewItem !!!!!!!!!!!
|
2005-08-13 20:13:21 +00:00
|
|
|
//FIXME nsPut
|
|
|
|
/*
|
2003-03-08 16:25:54 +00:00
|
|
|
void KEBListViewItem::nsPut(const QString &newModDate) {
|
2003-10-19 14:57:13 +00:00
|
|
|
static const QString NetscapeInfoAttribute = "netscapeinfo";
|
|
|
|
const QString info = m_bookmark.internalElement().attribute(NetscapeInfoAttribute);
|
|
|
|
QString blah = updateNsInfoMod(info, newModDate);
|
|
|
|
m_bookmark.internalElement().setAttribute(NetscapeInfoAttribute, blah);
|
|
|
|
TestLinkItrHolder::self()->setMod(m_bookmark.url().url(), newModDate);
|
2003-10-11 13:45:28 +00:00
|
|
|
setText(KEBListView::StatusColumn, newModDate);
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
2005-08-13 20:13:21 +00:00
|
|
|
*/
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2003-10-19 15:00:07 +00:00
|
|
|
// KEBListViewItem !!!!!!!!!!!
|
2005-08-13 20:13:21 +00:00
|
|
|
/*
|
2003-01-21 16:16:53 +00:00
|
|
|
void KEBListViewItem::modUpdate() {
|
2004-06-23 15:56:06 +00:00
|
|
|
QString nCreate, nAccess, oldModify;
|
|
|
|
QString iVisit;
|
|
|
|
|
2003-10-19 14:57:13 +00:00
|
|
|
QString nsinfo = m_bookmark.internalElement().attribute("netscapeinfo");
|
2004-06-23 15:56:06 +00:00
|
|
|
if (!nsinfo.isEmpty()) {
|
|
|
|
parseNsInfo(nsinfo, nCreate, nAccess, oldModify);
|
|
|
|
}
|
|
|
|
|
|
|
|
parseInfo(m_bookmark, iVisit);
|
|
|
|
|
2003-10-11 13:45:28 +00:00
|
|
|
QString statusLine;
|
2004-06-23 15:56:06 +00:00
|
|
|
statusLine = TestLinkItrHolder::calcPaintStyle(m_bookmark.url().url(), m_paintStyle, iVisit, oldModify);
|
2003-10-19 14:57:13 +00:00
|
|
|
if (statusLine != "Error")
|
2003-10-11 13:45:28 +00:00
|
|
|
setText(KEBListView::StatusColumn, statusLine);
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
2005-08-13 20:13:21 +00:00
|
|
|
*/
|
2003-10-19 14:57:13 +00:00
|
|
|
/* -------------------------- */
|
2003-03-08 13:22:06 +00:00
|
|
|
|
2003-10-19 15:00:07 +00:00
|
|
|
// KEBListViewItem !!!!!!!!!!!
|
2005-08-13 20:13:21 +00:00
|
|
|
/*
|
2003-03-08 15:54:58 +00:00
|
|
|
void KEBListViewItem::setOldStatus(const QString &oldStatus) {
|
2003-11-03 10:33:23 +00:00
|
|
|
// kdDebug() << "KEBListViewItem::setOldStatus" << endl;
|
2003-10-11 13:45:28 +00:00
|
|
|
m_oldStatus = oldStatus;
|
2003-03-08 15:54:58 +00:00
|
|
|
}
|
|
|
|
|
2003-10-19 15:00:07 +00:00
|
|
|
// KEBListViewItem !!!!!!!!!!!
|
2003-02-27 23:31:16 +00:00
|
|
|
void KEBListViewItem::setTmpStatus(const QString &status) {
|
2003-11-03 10:33:23 +00:00
|
|
|
// kdDebug() << "KEBListViewItem::setTmpStatus" << endl;
|
2003-10-11 13:45:28 +00:00
|
|
|
m_paintStyle = KEBListViewItem::BoldStyle;
|
|
|
|
setText(KEBListView::StatusColumn, status);
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
|
|
|
|
2003-10-19 15:00:07 +00:00
|
|
|
// KEBListViewItem !!!!!!!!!!!
|
2003-01-21 16:16:53 +00:00
|
|
|
void KEBListViewItem::restoreStatus() {
|
2003-10-11 13:45:28 +00:00
|
|
|
if (!m_oldStatus.isNull()) {
|
2003-11-03 10:33:23 +00:00
|
|
|
// kdDebug() << "KEBListViewItem::restoreStatus" << endl;
|
2003-10-19 14:57:13 +00:00
|
|
|
TestLinkItrHolder::self()->resetToValue(m_bookmark.url().url(), m_oldStatus);
|
2003-10-11 13:45:28 +00:00
|
|
|
modUpdate();
|
|
|
|
}
|
2003-01-21 16:16:53 +00:00
|
|
|
}
|
2005-08-13 20:13:21 +00:00
|
|
|
*/
|
2003-01-21 16:16:53 +00:00
|
|
|
#include "testlink.moc"
|