summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt14
-rw-r--r--kabc/addressee.cpp2
-rw-r--r--kabc/picture.cpp38
-rw-r--r--kabc/vcard/ContentLine.cpp30
-rw-r--r--kabc/vcard/VCardv.cpp77
-rw-r--r--kaddressbook/details/detailsviewcontainer.cpp11
-rw-r--r--kaddressbook/details/detailsviewcontainer.h1
-rw-r--r--kaddressbook/imagewidget.cpp7
-rw-r--r--kaddressbook/kabcore.cpp9
-rw-r--r--kaddressbook/kabcore.h9
-rw-r--r--kaddressbook/viewmanager.cpp1
-rw-r--r--kde2file/abdump/main.cpp2
-rw-r--r--kde2file/caldump/main.cpp2
-rw-r--r--korganizer/kolistview.cpp16
-rw-r--r--version2
15 files changed, 133 insertions, 88 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 2fd63e7..ff87423 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,58 +1,72 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 1.9.17 ************
KO/Pi:
Fixed that tooltips were not updated after moving an item in agenda view.
+Fixed a bug in sorting start date for recurring events in list view.
KA/Pi:
All fields search does now actually search all the (possible) fields,
not only those listed in the contact list.
+Made is possible to inline a picture in a vcard on the Z.
+This was only possible on the desktop, now is it possible on the Z as well.
+Fixed of missing save settings after filter configuration.
+Made saving of addressbook much faster.
+
+QWhatsThis was not working on the Z ( only black rectangle was shown).
+This is Fixed.
+
+KDE-Sync:
+Now readonly KDE resources are synced as well.
+(They are not changed in KDE itself, of course).
+
+
********** VERSION 1.9.16 ************
KO/Pi:
Fixed search dialog size on Z 6000 (480x640 display).
Added setting to hide/show time in agenda items.
Added setting to hide not running todos in todo view.
Added columns for start date/time in todo view.
Replaced the solid half-hour lines in agenda view by dot lines.
Added possibility of printing the What's Next View on the desktop
(i.e. Windows and Linux).
Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
Added tooltips in month view.(Tooltips only available on desktop)
Fixed a strange problem in KO/Pi alarm applet.
Did not find the actual problem,
such that now Qtopia reboots again if deinstalling the alarm applet.
But the alarm applet should work again.
KA/Pi:
Fixed the problem, that internal pictures were not saved.
Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes.
Fixed some minor problems. (Like word wrap in help text windows).
Fixed a compiling problem in microkde/kresources.
KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM.
This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9)
such that now syncing KO/Pi with Sharp DTM should work on the
Zaurus C 3000 model.
********** VERSION 1.9.15 ************
Usebilty enhancements in KO/Pi:
When clicking on the date in a month view cell, the day view is shown.
Old behaviour was, that the "new event" dialog popped up.
Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
That means, you can restore the latest
event/todo/journal you have deleted.
A journal is deleted, if you clear all the text of the journal.
Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
KA/Pi starting in 480x640 resolution:
Hide the filter action in toolbar
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 3ce733d..568dfc4 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -1638,159 +1638,161 @@ void Addressee::setKeys( const Key::List& list ) {
}
Key::List Addressee::keys() const
{
return mData->keys;
}
Key::List Addressee::keys( int type, QString customTypeString ) const
{
Key::List list;
Key::List::ConstIterator it;
for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) {
if ( (*it).type() == type ) {
if ( type == Key::Custom ) {
if ( customTypeString.isEmpty() ) {
list.append(*it);
} else {
if ( (*it).customTypeString() == customTypeString )
list.append(*it);
}
} else {
list.append(*it);
}
}
}
return list;
}
Key Addressee::findKey( const QString &id ) const
{
Key::List::ConstIterator it;
for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) {
if ( (*it).id() == id ) {
return *it;
}
}
return Key();
}
QString Addressee::asString() const
{
return "Smith, agent Smith...";
}
void Addressee::dump() const
{
return;
+#if 0
kdDebug(5700) << "Addressee {" << endl;
kdDebug(5700) << " Uid: '" << uid() << "'" << endl;
kdDebug(5700) << " Name: '" << name() << "'" << endl;
kdDebug(5700) << " FormattedName: '" << formattedName() << "'" << endl;
kdDebug(5700) << " FamilyName: '" << familyName() << "'" << endl;
kdDebug(5700) << " GivenName: '" << givenName() << "'" << endl;
kdDebug(5700) << " AdditionalName: '" << additionalName() << "'" << endl;
kdDebug(5700) << " Prefix: '" << prefix() << "'" << endl;
kdDebug(5700) << " Suffix: '" << suffix() << "'" << endl;
kdDebug(5700) << " NickName: '" << nickName() << "'" << endl;
kdDebug(5700) << " Birthday: '" << birthday().toString() << "'" << endl;
kdDebug(5700) << " Mailer: '" << mailer() << "'" << endl;
kdDebug(5700) << " TimeZone: '" << timeZone().asString() << "'" << endl;
kdDebug(5700) << " Geo: '" << geo().asString() << "'" << endl;
kdDebug(5700) << " Title: '" << title() << "'" << endl;
kdDebug(5700) << " Role: '" << role() << "'" << endl;
kdDebug(5700) << " Organization: '" << organization() << "'" << endl;
kdDebug(5700) << " Note: '" << note() << "'" << endl;
kdDebug(5700) << " ProductId: '" << productId() << "'" << endl;
kdDebug(5700) << " Revision: '" << revision().toString() << "'" << endl;
kdDebug(5700) << " SortString: '" << sortString() << "'" << endl;
kdDebug(5700) << " Url: '" << url().url() << "'" << endl;
kdDebug(5700) << " Secrecy: '" << secrecy().asString() << "'" << endl;
kdDebug(5700) << " Logo: '" << logo().asString() << "'" << endl;
kdDebug(5700) << " Photo: '" << photo().asString() << "'" << endl;
kdDebug(5700) << " Sound: '" << sound().asString() << "'" << endl;
kdDebug(5700) << " Agent: '" << agent().asString() << "'" << endl;
kdDebug(5700) << " Emails {" << endl;
QStringList e = emails();
QStringList::ConstIterator it;
for( it = e.begin(); it != e.end(); ++it ) {
kdDebug(5700) << " " << (*it) << endl;
}
kdDebug(5700) << " }" << endl;
kdDebug(5700) << " PhoneNumbers {" << endl;
PhoneNumber::List p = phoneNumbers();
PhoneNumber::List::ConstIterator it2;
for( it2 = p.begin(); it2 != p.end(); ++it2 ) {
kdDebug(5700) << " Type: " << int((*it2).type()) << " Number: " << (*it2).number() << endl;
}
kdDebug(5700) << " }" << endl;
Address::List a = addresses();
Address::List::ConstIterator it3;
for( it3 = a.begin(); it3 != a.end(); ++it3 ) {
(*it3).dump();
}
kdDebug(5700) << " Keys {" << endl;
Key::List k = keys();
Key::List::ConstIterator it4;
for( it4 = k.begin(); it4 != k.end(); ++it4 ) {
kdDebug(5700) << " Type: " << int((*it4).type()) <<
" Key: " << (*it4).textData() <<
" CustomString: " << (*it4).customTypeString() << endl;
}
kdDebug(5700) << " }" << endl;
kdDebug(5700) << "}" << endl;
+#endif
}
void Addressee::insertAddress( const Address &address )
{
detach();
mData->empty = false;
Address::List::Iterator it;
for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
if ( (*it).id() == address.id() ) {
*it = address;
return;
}
}
mData->addresses.append( address );
}
void Addressee::removeAddress( const Address &address )
{
detach();
Address::List::Iterator it;
for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
if ( (*it).id() == address.id() ) {
mData->addresses.remove( it );
return;
}
}
}
Address Addressee::address( int type ) const
{
Address address( type );
Address::List::ConstIterator it;
for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
if ( matchBinaryPatternA( (*it).type(), type ) ) {
if ( (*it).type() & Address::Pref )
return (*it);
else if ( address.isEmpty() )
address = (*it);
}
}
return address;
}
Address::List Addressee::addresses() const
diff --git a/kabc/picture.cpp b/kabc/picture.cpp
index 6a34b98..57aa297 100644
--- a/kabc/picture.cpp
+++ b/kabc/picture.cpp
@@ -8,106 +8,132 @@
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#include "picture.h"
using namespace KABC;
Picture::Picture()
: mIntern( false )
{
mUndefined = true;
}
Picture::Picture( const QString &url )
: mUrl( url ), mIntern( false )
{
mUndefined = false;
}
Picture::Picture( const QImage &data )
: mData( data ), mIntern( true )
{
mUndefined = false;
}
Picture::~Picture()
{
}
bool Picture::operator==( const Picture &p ) const
{
- if ( mIntern != p.mIntern ) return false;
-
+ //qDebug("compare PIC ");
+ if ( mUndefined && p.mUndefined ) {
+ //qDebug("compare PIC true 1 ");
+ return true;
+ }
+ if ( mUndefined || p.mUndefined ) {
+ //qDebug("compare PIC false 1");
+ return false;
+ }
+ // now we should deal with two defined pics!
+ if ( mIntern != p.mIntern ) {
+ //qDebug("compare PIC false 2");
+ return false;
+ }
if ( mIntern ) {
- if ( mData != p.mData )
+ //qDebug("mIntern ");
+ if ( mData.isNull() && p.mData.isNull() ) {
+ //qDebug("compare PIC true 2 ");
+ return true;
+ }
+ if ( mData.isNull() || p.mData.isNull() ){
+ //qDebug("compare PIC false 3-1");
+
+ return false;
+ }
+ if ( mData != p.mData ) {
+ //qDebug("compare PIC false 3");
return false;
+ }
} else {
- if ( mUrl != p.mUrl )
- return false;
+ if ( mUrl != p.mUrl ) {
+ //qDebug("compare PIC false 4");
+ return false;
+ }
}
-
+ //qDebug("compare PIC true ");
return true;
}
bool Picture::operator!=( const Picture &p ) const
{
return !( p == *this );
}
void Picture::setUrl( const QString &url )
{
mUrl = url;
mIntern = false;
mUndefined = false;
}
void Picture::setData( const QImage &data )
{
mData = data;
mIntern = true;
mUndefined = false;
}
void Picture::setType( const QString &type )
{
mType = type;
}
bool Picture::isIntern() const
{
return mIntern;
}
QString Picture::url() const
{
return mUrl;
}
QImage Picture::data() const
{
return mData;
}
QPixmap Picture::pixmap() const
{
QPixmap p;
p.convertFromImage ( mData );
return p;
}
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp
index c368172..2f88cde 100644
--- a/kabc/vcard/ContentLine.cpp
+++ b/kabc/vcard/ContentLine.cpp
@@ -228,94 +228,122 @@ ContentLine::_parse()
RTokenise(paraValue, ",", paraValues);
QStrListIterator it2( paraValues );
for(; it2.current(); ++it2) {
Param *p = new Param;
p->setName( paraName );
p->setValue( *it2 );
paramList_.append(p);
}
}
// Create a new value of the correct type.
valueType_ = EntityTypeToValueType(entityType_);
// kdDebug(5710) << "valueType: " << valueType_ << endl;
switch (valueType_) {
case ValueSound: value_ = new SoundValue; break;
case ValueAgent: value_ = new AgentValue; break;
case ValueAddress: value_ = new AdrValue; break;
case ValueTel: value_ = new TelValue; break;
case ValueTextBin: value_ = new TextBinValue; break;
case ValueOrg: value_ = new OrgValue; break;
case ValueN: value_ = new NValue; break;
case ValueUTC: value_ = new UTCValue; break;
case ValueURI: value_ = new URIValue; break;
case ValueClass: value_ = new ClassValue; break;
case ValueFloat: value_ = new FloatValue; break;
case ValueImage: value_ = new ImageValue; break;
case ValueDate: value_ = new DateValue; break;
case ValueTextList: value_ = new TextListValue; break;
case ValueGeo: value_ = new GeoValue; break;
case ValueText:
case ValueUnknown:
default: value_ = new TextValue; break;
}
*value_ = valuePart;
}
void
ContentLine::_assemble()
{
+ //strRep_.truncate(0);
+ QString line;
+ if (!group_.isEmpty())
+ line = group_ + '.';
+ line += name_;
+ ParamListIterator it(paramList_);
+ for (; it.current(); ++it)
+ line += ";" + it.current()->asString();
+
+ if (value_ != 0)
+ line += ":" + value_->asString();
+
+ line = line.replace( QRegExp( "\n" ), "\\n" );
+
+ // Fold lines longer than 72 chars
+ const int maxLen = 72;
+ uint cursor = 0;
+ QString cut;
+ while( line.length() > ( cursor + 1 ) * maxLen ) {
+ cut += line.mid( cursor * maxLen, maxLen );
+ cut += "\r\n ";
+ ++cursor;
+ }
+ cut += line.mid( cursor * maxLen );
+ strRep_ = cut.latin1();
+ //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data());
+#if 0
vDebug("Assemble (argl) - my name is \"" + name_ + "\"");
strRep_.truncate(0);
QCString line;
if (!group_.isEmpty())
line += group_ + '.';
line += name_;
vDebug("Adding parameters");
ParamListIterator it(paramList_);
for (; it.current(); ++it)
line += ";" + it.current()->asString();
vDebug("Adding value");
if (value_ != 0)
line += ":" + value_->asString();
else
vDebug("No value");
// Quote newlines
line = line.replace( QRegExp( "\n" ), "\\n" );
// Fold lines longer than 72 chars
const int maxLen = 72;
uint cursor = 0;
while( line.length() > ( cursor + 1 ) * maxLen ) {
strRep_ += line.mid( cursor * maxLen, maxLen );
strRep_ += "\r\n ";
++cursor;
}
strRep_ += line.mid( cursor * maxLen );
- //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data());
+ qDebug("ContentLine::_assemble()\n%s*****", strRep_.data());
+#endif
}
void
ContentLine::clear()
{
group_.truncate(0);
name_.truncate(0);
paramList_.clear();
delete value_;
value_ = 0;
}
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp
index bc80707..49bfe43 100644
--- a/kabc/vcard/VCardv.cpp
+++ b/kabc/vcard/VCardv.cpp
@@ -1,274 +1,269 @@
/*
libvcard - vCard parsing library for vCard version 3.0
Copyright (C) 1998 Rik Hemsley rik@kde.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <qcstring.h>
#include <qstrlist.h>
+#include <qstringlist.h>
+#include <qstring.h>
+#include <qvaluelist.h>
#include <VCardEntity.h>
#include <VCardVCard.h>
#include <VCardContentLine.h>
#include <VCardRToken.h>
#include <VCardDefines.h>
using namespace VCARD;
VCard::VCard()
: Entity()
{
contentLineList_.setAutoDelete( TRUE );
}
VCard::VCard(const VCard & x)
: Entity(x),
group_(x.group_)
{
contentLineList_.setAutoDelete( TRUE );
QPtrListIterator<ContentLine> it(x.contentLineList_);
for (; it.current(); ++it) {
ContentLine * c = new ContentLine(*it.current());
contentLineList_.append(c);
}
}
VCard::VCard(const QCString & s)
: Entity(s)
{
contentLineList_.setAutoDelete( TRUE );
}
VCard &
VCard::operator = (VCard & x)
{
if (*this == x) return *this;
group_ = x.group();
QPtrListIterator<ContentLine> it(x.contentLineList_);
for (; it.current(); ++it) {
ContentLine * c = new ContentLine(*it.current());
contentLineList_.append(c);
}
Entity::operator = (x);
return *this;
}
VCard &
VCard::operator = (const QCString & s)
{
Entity::operator = (s);
return *this;
}
bool
VCard::operator == (VCard & x)
{
x.parse();
return false;
}
VCard::~VCard()
{
}
void
VCard::_parse()
{
- vDebug("parse() called");
- QStrList l;
+
+ QStringList l;
+ QStrList sl;
- RTokenise(strRep_, "\r\n", l);
+ RTokenise(strRep_, "\r\n", sl);
- if (l.count() < 3) { // Invalid VCARD !
- vDebug("Invalid vcard");
+ if (sl.count() < 3) { // Invalid VCARD !
+ //qDebug("invalid vcard ");
return;
}
-
+ l = QStringList::fromStrList( sl );
// Get the first line
- QCString beginLine = QCString(l.at(0)).stripWhiteSpace();
-
- vDebug("Begin line == \"" + beginLine + "\"");
+ QString beginLine = l[0].stripWhiteSpace();
// Remove extra blank lines
- while (QCString(l.last()).isEmpty())
+ while (l.last().isEmpty())
l.remove(l.last());
// Now we know this is the last line
- QCString endLine = l.last();
+ QString endLine = l.last();
// Trash the first and last lines as we have seen them.
- l.remove(0u);
+ l.remove(l.first());
l.remove(l.last());
///////////////////////////////////////////////////////////////
// FIRST LINE
int split = beginLine.find(':');
if (split == -1) { // invalid, no BEGIN
vDebug("No split");
return;
}
- QCString firstPart(beginLine.left(split));
- QCString valuePart(beginLine.mid(split + 1));
+ QString firstPart(beginLine.left(split));
+ QString valuePart(beginLine.mid(split + 1));
split = firstPart.find('.');
if (split != -1) {
group_ = firstPart.left(split);
firstPart = firstPart.right(firstPart.length() - split - 1);
}
- if (qstrnicmp(firstPart, "BEGIN", 5) != 0) { // No BEGIN !
- vDebug("No BEGIN");
+ if (firstPart.left(5) != "BEGIN" ) { // No BEGIN !
+ qDebug("no BEGIN in vcard ");
return;
}
- if (qstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard !
- vDebug("No VCARD");
+ if (valuePart.left(5) != "VCARD") { // Not a vcard !
+ qDebug("not a VCARD ");
return;
}
///////////////////////////////////////////////////////////////
// CONTENT LINES
//
vDebug("Content lines");
// Handle folded lines.
- QStrList refolded;
-
- QStrListIterator it(l);
+ QStringList refolded;
- QCString cur;
- for (; it.current(); ++it) {
+ QStringList::Iterator it = l.begin();
- cur = it.current();
+ QString cur;
+ for (; it != l.end(); ++it) {
+ cur = (*it);
++it;
-
- while (
- it.current() &&
- it.current()[0] == ' ' &&
- strlen(it.current()) != 1)
- {
- cur += it.current() + 1;
+ while ( it!= l.end() && (*it).at(0) == ' ' && (*it).length()!= 1) {
+ cur += (*it) ;
++it;
}
-
--it;
-
refolded.append(cur);
}
-
- QStrListIterator it2(refolded);
-
- for (; it2.current(); ++it2) {
- vDebug("New contentline using \"" + QCString(it2.current()) + "\"");
- ContentLine * cl = new ContentLine(it2.current());
-
+ QStringList::Iterator it2 = refolded.begin();
+ for (; it2 != refolded.end(); ++it2) {
+ ContentLine * cl = new ContentLine(QCString((*it2).latin1()));
cl->parse();
if (cl->value() == 0)
{
- qDebug("Content line could not be parsed. Discarded: %s", it2.current());
+ qDebug("Content line could not be parsed. Discarded: %s", (*it2).latin1());
delete cl;
}
else
contentLineList_.append(cl);
}
///////////////////////////////////////////////////////////////
// LAST LINE
+
+ // LR: sorry, but the remaining code in this method makes no sense
+
+#if 0
split = endLine.find(':');
if (split == -1) // invalid, no END
return;
firstPart = endLine.left(split);
valuePart = endLine.right(firstPart.length() - split - 1);
split = firstPart.find('.');
if (split != -1) {
group_ = firstPart.left(split);
firstPart = firstPart.right(firstPart.length() - split - 1);
}
if (qstricmp(firstPart, "END") != 0) // No END !
return;
if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard !
return;
+#endif
}
void
VCard::_assemble()
{
vDebug("Assembling vcard");
strRep_ = "BEGIN:VCARD\r\n";
strRep_ += "VERSION:3.0\r\n";
QPtrListIterator<ContentLine> it(contentLineList_);
for (; it.current(); ++it)
strRep_ += it.current()->asString() + "\r\n";
strRep_ += "END:VCARD\r\n";
}
bool
VCard::has(EntityType t)
{
parse();
return contentLine(t) == 0 ? false : true;
}
bool
VCard::has(const QCString & s)
{
parse();
return contentLine(s) == 0 ? false : true;
}
void
VCard::add(const ContentLine & cl)
{
parse();
ContentLine * c = new ContentLine(cl);
contentLineList_.append(c);
}
void
VCard::add(const QCString & s)
{
parse();
ContentLine * c = new ContentLine(s);
contentLineList_.append(c);
}
ContentLine *
diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp
index ceffc77..229cce0 100644
--- a/kaddressbook/details/detailsviewcontainer.cpp
+++ b/kaddressbook/details/detailsviewcontainer.cpp
@@ -84,86 +84,77 @@ KABBasicLook *ViewContainer::currentLook()
}
void ViewContainer::registerLooks()
{
mLookFactories.append( new KABHtmlViewFactory( mDetailsStack ) );
// mLookFactories.append( new KABDetailedViewFactory( mDetailsStack ) );
mStyleCombo->clear();
for ( uint i = 0; i < mLookFactories.count(); ++i )
mStyleCombo->insertItem( mLookFactories.at( i )->description() );
if ( !mLookFactories.isEmpty() )
slotStyleSelected( 0 );
}
void ViewContainer::slotStyleSelected( int index )
{
#ifndef KAB_EMBEDDED
KConfig *config = kapp->config();
#else //KAB_EMBEDDED
//US I hope I got the same config object as above expected.
KConfig *config = KABPrefs::instance()->getConfig();
#endif //KAB_EMBEDDED
KABC::Addressee addr;
if ( index >= 0 && index < mStyleCombo->count() ) {
if ( mCurrentLook != 0 ) {
mCurrentLook->saveSettings( config );
addr = mCurrentLook->addressee();
delete mCurrentLook;
mCurrentLook = 0;
}
KABLookFactory *factory = mLookFactories.at( index );
mCurrentLook = factory->create();
mDetailsStack->raiseWidget( mCurrentLook );
connect( mCurrentLook, SIGNAL( sendEmail( const QString& ) ), this,
SIGNAL( sendEmail( const QString& ) ) );
connect( mCurrentLook, SIGNAL( browse( const QString& ) ), this,
SIGNAL( browse( const QString& ) ) );
}
mCurrentLook->restoreSettings( config );
mCurrentLook->setAddressee( addr );
}
-void ViewContainer::refreshView()
-{
- if ( mCurrentLook ) {
- mCurrentLook->setAddressee( mCurrentAddressee );
- }
-}
void ViewContainer::setAddressee( const KABC::Addressee& addressee )
{
if ( mCurrentLook != 0 ) {
- if ( addressee == mCurrentAddressee )
- return;
- else {
mCurrentAddressee = addressee;
mCurrentLook->setAddressee( mCurrentAddressee );
- }
+
}
}
KABC::Addressee ViewContainer::addressee()
{
static KABC::Addressee empty; // do not use!
if ( !mCurrentLook )
return empty;
else
return mCurrentLook->addressee();
}
void ViewContainer::setReadOnly( bool state )
{
if ( mCurrentLook )
mCurrentLook->setReadOnly( state );
}
#ifndef KAB_EMBEDDED
#include "detailsviewcontainer.moc"
#endif //KAB_EMBEDDED
diff --git a/kaddressbook/details/detailsviewcontainer.h b/kaddressbook/details/detailsviewcontainer.h
index b561d12..667f0cb 100644
--- a/kaddressbook/details/detailsviewcontainer.h
+++ b/kaddressbook/details/detailsviewcontainer.h
@@ -1,96 +1,95 @@
/*
This file is part of KAddressBook.
Copyright (c) 1996-2002 Mirko Boehm <mirko@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef DETAILSVIEWCONTAINER_H
#define DETAILSVIEWCONTAINER_H
#include <qptrlist.h>
#include "look_basic.h"
class QComboBox;
class QWidgetStack;
class ViewContainer : public QWidget
{
Q_OBJECT
public:
ViewContainer( QWidget *parent = 0, const char* name = 0 );
/**
Return the look currently selected. If there is none, it
returns zero. Do not use this pointer to store a reference
to a look, the user might select another one (e.g., create
a new object) at any time.
*/
KABBasicLook *currentLook();
- void refreshView();
/**
Return the contact currently displayed.
*/
KABC::Addressee addressee();
public slots:
/**
Set the contact currently displayed.
*/
void setAddressee( const KABC::Addressee& addressee );
/**
Set read-write state.
*/
void setReadOnly( bool state );
signals:
/**
The contact has been changed.
*/
void addresseeChanged();
/**
The user acticated the email address displayed. This may happen
by, for example, clicking on the displayed mailto-URL.
*/
void sendEmail( const QString& );
/**
The user activated one of the displayed HTTP URLs. For example
by clicking on the displayed homepage address.
*/
void browse( const QString& );
protected:
/**
A style has been selected. Overloaded from base class.
*/
void slotStyleSelected( int );
/**
Register the available looks.
*/
void registerLooks();
private:
KABC::Addressee mCurrentAddressee;
KABBasicLook *mCurrentLook;
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp
index 49d456b..48370e3 100644
--- a/kaddressbook/imagewidget.cpp
+++ b/kaddressbook/imagewidget.cpp
@@ -86,100 +86,96 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name )
boxLayout->setRowStretch( 2, 1 );
mLogoLabel = new QLabel( logoBox );
mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac );
mLogoLabel->setScaledContents( true );
mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
boxLayout->addMultiCellWidget( mLogoLabel, 0, 2, 0, 0 );
mLogoUrl = new KURLRequester( logoBox );
#ifndef KAB_EMBEDDED
mLogoUrl->setFilter( KImageIO::pattern() );
#else //KAB_EMBEDDED
//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2");
#endif //KAB_EMBEDDED
boxLayout->addWidget( mLogoUrl, 0, 1 );
mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), logoBox );
mUseLogoUrl->setEnabled( false );
boxLayout->addWidget( mUseLogoUrl, 1, 1 );
topLayout->addWidget( logoBox, 1, 0 );
connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ),
SIGNAL( changed() ) );
connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
SLOT( loadPhoto() ) );
connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
SIGNAL( changed() ) );
connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
SLOT( updateGUI() ) );
connect( mUsePhotoUrl, SIGNAL( toggled( bool ) ),
SIGNAL( changed() ) );
connect( mLogoUrl, SIGNAL( textChanged( const QString& ) ),
SIGNAL( changed() ) );
connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
SLOT( loadLogo() ) );
connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
SIGNAL( changed() ) );
connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
SLOT( updateGUI() ) );
connect( mUseLogoUrl, SIGNAL( toggled( bool ) ),
SIGNAL( changed() ) );
#ifndef KAB_EMBEDDED
KAcceleratorManager::manage( this );
#endif //KAB_EMBEDDED
-#ifndef DESKTOP_VERSION
- mUsePhotoUrl->setChecked( true );
- mUseLogoUrl->setChecked( true );
-#endif
}
ImageWidget::~ImageWidget()
{
}
void ImageWidget::setPhoto( const KABC::Picture &photo )
{
bool blocked = signalsBlocked();
blockSignals( true );
if ( photo.isIntern() ) {
//US
//US mPhotoLabel->setPixmap( photo.data() );
if (photo.data().isNull() != true)
{
QPixmap pm;
pm.convertFromImage(photo.data());
mPhotoLabel->setPixmap( pm );
}
mUsePhotoUrl->setChecked( false );
} else {
mPhotoUrl->setURL( photo.url() );
if ( !photo.url().isEmpty() )
mUsePhotoUrl->setChecked( true );
loadPhoto();
}
blockSignals( blocked );
}
KABC::Picture ImageWidget::photo() const
{
KABC::Picture photo;
if ( mUsePhotoUrl->isChecked() )
photo.setUrl( mPhotoUrl->url() );
else {
QPixmap *px = mPhotoLabel->pixmap();
if ( px ) {
#ifndef KAB_EMBEDDED
if ( px->height() > px->width() )
photo.setData( px->convertToImage().scaleHeight( 140 ) );
else
photo.setData( px->convertToImage().scaleWidth( 100 ) );
#else //KAB_EMBEDDED
@@ -215,85 +211,84 @@ void ImageWidget::setLogo( const KABC::Picture &logo )
if ( !logo.url().isEmpty() )
mUseLogoUrl->setChecked( true );
loadLogo();
}
blockSignals( blocked );
}
KABC::Picture ImageWidget::logo() const
{
KABC::Picture logo;
if ( mUseLogoUrl->isChecked() )
logo.setUrl( mLogoUrl->url() );
else {
QPixmap *px = mLogoLabel->pixmap();
if ( px ) {
#ifndef KAB_EMBEDDED
if ( px->height() > px->width() )
logo.setData( px->convertToImage().scaleHeight( 140 ) );
else
logo.setData( px->convertToImage().scaleWidth( 100 ) );
#else //KAB_EMBEDDED
logo.setData( px->convertToImage() );
#endif //KAB_EMBEDDED
logo.setType( "PNG" );
}
}
return logo;
}
void ImageWidget::loadPhoto()
{
mPhotoLabel->setPixmap( loadPixmap( mPhotoUrl->url() ) );
}
void ImageWidget::loadLogo()
{
mLogoLabel->setPixmap( loadPixmap( mLogoUrl->url() ) );
}
void ImageWidget::updateGUI()
{
KURLRequester *ptr = (KURLRequester*)sender();
-#ifdef DESKTOP_VERSION
+
if ( ptr == mPhotoUrl )
mUsePhotoUrl->setEnabled( true );
else if ( ptr == mLogoUrl )
mUseLogoUrl->setEnabled( true );
-#endif
}
QPixmap ImageWidget::loadPixmap( const KURL &url )
{
QString tempFile;
QPixmap pixmap;
if ( url.isEmpty() )
return pixmap;
if ( url.isLocalFile() )
pixmap = QPixmap( url.path() );
else
{
#ifndef KAB_EMBEDDED
if ( KIO::NetAccess::download( url, tempFile ) ) {
pixmap = QPixmap( tempFile );
KIO::NetAccess::removeTempFile( tempFile );
}
#else //KAB_EMBEDDED
qDebug("ImageWidget::loadPixmap : only local pixmaps are allowed");
#endif //KAB_EMBEDDED
}
return pixmap;
}
#ifndef KAB_EMBEDDED
#include "imagewidget.moc"
#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index f6bdda4..e14e579 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1081,137 +1081,134 @@ void KABCore::setCategories()
message( i18n("Setting categories ... please wait!") );
QStringList categories = dlg.selectedCategories();
//QStringList uids = mViewManager->selectedUids();
QStringList::Iterator it;
for ( it = uids.begin(); it != uids.end(); ++it ) {
KABC::Addressee addr = mAddressBook->findByUid( *it );
if ( !addr.isEmpty() ) {
if ( !merge )
addr.setCategories( categories );
else {
QStringList addrCategories = addr.categories();
QStringList::Iterator catIt;
for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) {
if ( !addrCategories.contains( *catIt ) )
addrCategories.append( *catIt );
}
addr.setCategories( addrCategories );
}
mAddressBook->insertAddressee( addr );
}
}
if ( uids.count() > 0 )
setModified( true );
message( i18n("Setting categories completed!") );
}
void KABCore::setSearchFields( const KABC::Field::List &fields )
{
mIncSearchWidget->setFields( fields );
}
void KABCore::incrementalSearch( const QString& text )
{
mViewManager->doSearch( text, mIncSearchWidget->currentField() );
}
void KABCore::setModified()
{
setModified( true );
}
void KABCore::setModifiedWOrefresh()
{
// qDebug("KABCore::setModifiedWOrefresh() ");
mModified = true;
mActionSave->setEnabled( mModified );
-#ifdef DESKTOP_VERSION
- mDetails->refreshView();
-#endif
+
}
void KABCore::setModified( bool modified )
{
mModified = modified;
mActionSave->setEnabled( mModified );
if ( modified )
mJumpButtonBar->recreateButtons();
mViewManager->refreshView();
- mDetails->refreshView();
}
bool KABCore::modified() const
{
return mModified;
}
void KABCore::contactModified( const KABC::Addressee &addr )
{
Command *command = 0;
QString uid;
// check if it exists already
KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() );
if ( origAddr.isEmpty() )
command = new PwNewCommand( mAddressBook, addr );
else {
command = new PwEditCommand( mAddressBook, origAddr, addr );
uid = addr.uid();
}
UndoStack::instance()->push( command );
RedoStack::instance()->clear();
-
+ mDetails->setAddressee( addr );
setModified( true );
}
void KABCore::newContact()
{
QPtrList<KABC::Resource> kabcResources = mAddressBook->resources();
QPtrList<KRES::Resource> kresResources;
QPtrListIterator<KABC::Resource> it( kabcResources );
KABC::Resource *resource;
while ( ( resource = it.current() ) != 0 ) {
++it;
if ( !resource->readOnly() ) {
KRES::Resource *res = static_cast<KRES::Resource*>( resource );
if ( res )
kresResources.append( res );
}
}
KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this );
resource = static_cast<KABC::Resource*>( res );
if ( resource ) {
KABC::Addressee addr;
addr.setResource( resource );
mEditorDialog->setAddressee( addr );
KApplication::execDialog ( mEditorDialog );
} else
return;
// mEditorDict.insert( dialog->addressee().uid(), dialog );
}
void KABCore::addEmail( QString aStr )
{
#ifndef KAB_EMBEDDED
QString fullName, email;
KABC::Addressee::parseEmailAddress( aStr, fullName, email );
// Try to lookup the addressee matching the email address
bool found = false;
QStringList emailList;
@@ -1588,97 +1585,96 @@ void KABCore::print()
wizard.exec();
#else //KAB_EMBEDDED
qDebug("KABCore::print() finsih method");
#endif //KAB_EMBEDDED
}
void KABCore::addGUIClient( KXMLGUIClient *client )
{
if ( mGUIClient )
mGUIClient->insertChildClient( client );
else
KMessageBox::error( this, "no KXMLGUICLient");
}
void KABCore::configurationChanged()
{
mExtensionManager->reconfigure();
}
void KABCore::addressBookChanged()
{
/*US
QDictIterator<AddresseeEditorDialog> it( mEditorDict );
while ( it.current() ) {
if ( it.current()->dirty() ) {
QString text = i18n( "Data has been changed externally. Unsaved "
"changes will be lost." );
KMessageBox::information( this, text );
}
it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
++it;
}
*/
if (mEditorDialog)
{
if (mEditorDialog->dirty())
{
QString text = i18n( "Data has been changed externally. Unsaved "
"changes will be lost." );
KMessageBox::information( this, text );
}
QString currentuid = mEditorDialog->addressee().uid();
mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) );
}
mViewManager->refreshView();
-// mDetails->refreshView();
}
AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
const char *name )
{
if ( mEditorDialog == 0 ) {
mEditorDialog = new AddresseeEditorDialog( this, parent,
name ? name : "editorDialog" );
connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
SLOT( contactModified( const KABC::Addressee& ) ) );
//connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
// SLOT( slotEditorDestroyed( const QString& ) ) ;
}
return mEditorDialog;
}
void KABCore::slotEditorDestroyed( const QString &uid )
{
//mEditorDict.remove( uid );
}
void KABCore::initGUI()
{
#ifndef KAB_EMBEDDED
QHBoxLayout *topLayout = new QHBoxLayout( this );
topLayout->setSpacing( KDialogBase::spacingHint() );
mExtensionBarSplitter = new QSplitter( this );
mExtensionBarSplitter->setOrientation( Qt::Vertical );
mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
QVBox *viewSpace = new QVBox( mDetailsSplitter );
mIncSearchWidget = new IncSearchWidget( viewSpace );
connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
SLOT( incrementalSearch( const QString& ) ) );
mViewManager = new ViewManager( this, viewSpace );
viewSpace->setStretchFactor( mViewManager, 1 );
mDetails = new ViewContainer( mDetailsSplitter );
@@ -2244,97 +2240,96 @@ void KABCore::manageCategories( )
int dh = QApplication::desktop()->height();
cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
if ( !cp->exec() ) {
delete cp;
return;
}
int count = 0;
message( i18n("Please wait, processing categories..."));
if ( cp->addCat() ) {
KABC::AddressBook::Iterator it;
QStringList catList = KABPrefs::instance()->mCustomCategories;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
QStringList catIncList = (*it).categories();
int i;
for( i = 0; i< catIncList.count(); ++i ) {
if ( !catList.contains (catIncList[i])) {
catList.append( catIncList[i] );
//qDebug("add cat %s ", catIncList[i].latin1());
++count;
}
}
}
catList.sort();
KABPrefs::instance()->mCustomCategories = catList;
KABPrefs::instance()->writeConfig();
message(QString::number( count )+ i18n(" categories added to list! "));
} else {
QStringList catList = KABPrefs::instance()->mCustomCategories;
QStringList catIncList;
QStringList newCatList;
KABC::AddressBook::Iterator it;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
QStringList catIncList = (*it).categories();
int i;
if ( catIncList.count() ) {
newCatList.clear();
for( i = 0; i< catIncList.count(); ++i ) {
if ( catList.contains (catIncList[i])) {
newCatList.append( catIncList[i] );
}
}
newCatList.sort();
(*it).setCategories( newCatList );
mAddressBook->insertAddressee( (*it) );
}
}
setModified( true );
mViewManager->refreshView();
- mDetails->refreshView();
message( i18n("Removing categories done!"));
}
delete cp;
}
void KABCore::removeVoice()
{
if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
return;
KABC::Addressee::List list;
XXPortSelectDialog dlg( this, false, this );
if ( dlg.exec() )
list = dlg.contacts();
else
return;
KABC::Addressee::List::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
if ( (*it).removeVoice() )
contactModified((*it) );
}
}
void KABCore::clipboardDataChanged()
{
if ( mReadWrite )
mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
}
void KABCore::updateActionMenu()
{
UndoStack *undo = UndoStack::instance();
RedoStack *redo = RedoStack::instance();
if ( undo->isEmpty() )
mActionUndo->setText( i18n( "Undo" ) );
else
mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
mActionUndo->setEnabled( !undo->isEmpty() );
if ( !redo->top() )
mActionRedo->setText( i18n( "Redo" ) );
else
mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index c7c12ff..85ffbdb 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -50,100 +50,97 @@ class KAddressBookService;
class LDAPSearchDialog;
#else //KAB_EMBEDDED
class KAddressBookMain;
//US class QAction;
#endif //KAB_EMBEDDED
class KCMultiDialog;
class KXMLGUIClient;
class ExtensionManager;
class XXPortManager;
class JumpButtonBar;
class IncSearchWidget;
class KDGanttMinimizeSplitter;
class KAction;
class KActionCollection;
class KToggleAction;
class KSyncProfile;
class QAction;
class QMenuBar;
class QSplitter;
class ViewContainer;
class ViewManager;
class AddresseeEditorDialog;
class Ir;
class KABCore : public QWidget, public KSyncInterface
{
Q_OBJECT
public:
KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 );
~KABCore();
#ifdef KAB_EMBEDDED
//US added functionality
QPopupMenu* getViewMenu() {return viewMenu;}
QPopupMenu* getFilterMenu() {return filterMenu;}
QPopupMenu* getSettingsMenu() {return settingsMenu;}
void addActionsManually();
#endif //KAB_EMBEDDED
/**
Restores the global settings.
*/
void restoreSettings();
- /**
- Saves the global settings.
- */
- void saveSettings();
+
/**
Returns a pointer to the StdAddressBook of the application.
*/
KABC::AddressBook *addressBook() const;
/**
Returns a pointer to the KConfig object of the application.
*/
static KConfig *config();
/**
Returns a pointer to the global KActionCollection object. So
other classes can register their actions easily.
*/
KActionCollection *actionCollection() const;
/**
Returns the current search field of the Incremental Search Widget.
*/
KABC::Field *currentSearchField() const;
/**
Returns the uid list of the currently selected contacts.
*/
QStringList selectedUIDs() const;
/**
Displays the ResourceSelectDialog and returns the selected
resource or a null pointer if no resource was selected by
the user.
*/
KABC::Resource *requestResource( QWidget *parent );
#ifndef KAB_EMBEDDED
static KAboutData *createAboutData();
#endif //KAB_EMBEDDED
#ifdef KAB_EMBEDDED
inline QPopupMenu* getImportMenu() { return ImportMenu;}
inline QPopupMenu* getExportMenu() { return ExportMenu;}
#endif //KAB_EMBEDDED
public slots:
#ifdef KAB_EMBEDDED
void createAboutData();
#endif //KAB_EMBEDDED
void setDetailsToggle();
@@ -313,97 +310,99 @@ class KABCore : public QWidget, public KSyncInterface
Shows the edit dialog for the given uid. If the uid is QString::null,
the method will try to find a selected addressee in the view.
*/
void editContact( const QString &uid /*US = QString::null*/ );
//US added a second method without defaultparameter
void editContact2();
/**
Shows or edits the detail view for the given uid. If the uid is QString::null,
the method will try to find a selected addressee in the view.
*/
void executeContact( const QString &uid /*US = QString::null*/ );
/**
Launches the configuration dialog.
*/
void openConfigDialog();
/**
Launches the ldap search dialog.
*/
void openLDAPDialog();
/**
Creates a KAddressBookPrinter, which will display the print
dialog and do the printing.
*/
void print();
/**
Registers a new GUI client, so plugins can register its actions.
*/
void addGUIClient( KXMLGUIClient *client );
void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid);
void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid);
signals:
void contactSelected( const QString &name );
void contactSelected( const QPixmap &pixmap );
public slots:
void recieve(QString cmsg );
void getFile( bool success );
void syncFileRequest();
void setDetailsVisible( bool visible );
void setDetailsToState();
- // void slotSyncMenu( int );
+
+ void saveSettings();
+
private slots:
void updateToolBar();
void updateMainWindow();
void receive( const QCString& cmsg, const QByteArray& data );
void toggleBeamReceive( );
void disableBR(bool);
void setJumpButtonBarVisible( bool visible );
void setCaptionBack();
void importFromOL();
void extensionModified( const KABC::Addressee::List &list );
void extensionChanged( int id );
void clipboardDataChanged();
void updateActionMenu();
void configureKeyBindings();
void removeVoice();
#ifdef KAB_EMBEDDED
void configureResources();
#endif //KAB_EMBEDDED
void slotEditorDestroyed( const QString &uid );
void configurationChanged();
void addressBookChanged();
private:
void resizeEvent(QResizeEvent* e );
bool mBRdisabled;
#ifndef DESKTOP_VERSION
QCopChannel* infrared;
#endif
QTimer *mMessageTimer;
void initGUI();
void initActions();
QString getPhoneFile();
AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
const char *name = 0 );
KXMLGUIClient *mGUIClient;
KABC::AddressBook *mAddressBook;
ViewManager *mViewManager;
// QSplitter *mDetailsSplitter;
KDGanttMinimizeSplitter *mExtensionBarSplitter;
ViewContainer *mDetails;
KDGanttMinimizeSplitter* mMiniSplitter;
XXPortManager *mXXPortManager;
JumpButtonBar *mJumpButtonBar;
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 33bef5a..59bddd9 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -560,96 +560,97 @@ void ViewManager::startDrag()
drag->dragCopy();
#else //KAB_EMBEDDED
qDebug("ViewManager::startDrag() has to be changed!!" );
#endif //KAB_EMBEDDED
}
void ViewManager::doSearch( const QString& s,KABC::Field *field )
{
if ( mActiveView )
mActiveView->doSearch( s, field );
}
void ViewManager::setActiveFilter( int index )
{
Filter currentFilter;
if ( ( index - 1 ) < 0 )
currentFilter = Filter();
else
currentFilter = mFilterList[ index - 1 ];
// Check if we have a view. Since the filter combo is created before
// the view, this slot could be called before there is a valid view.
if ( mActiveView ) {
mActiveView->setFilter( currentFilter );
mActiveView->refresh();
emit selected( QString::null );
}
}
void ViewManager::configureFilters()
{
FilterDialog dlg( this );
dlg.setFilters( mFilterList );
if ( dlg.exec() )
mFilterList = dlg.filters();
uint pos = mActionSelectFilter->currentItem();
mActionSelectFilter->setItems( filterNames() );
mActionSelectFilter->setCurrentItem( pos );
setActiveFilter( pos );
int cw = 150;
if (QApplication::desktop()->width() == 480 )
cw = 0;
mActionSelectFilter->setComboWidth( cw );
+ saveSettings();
}
QStringList ViewManager::filterNames() const
{
QStringList names( i18n( "No Filter" ) );
Filter::List::ConstIterator it;
for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
names.append( (*it).name() );
return names;
}
int ViewManager::filterPosition( const QString &name ) const
{
int pos = 0;
Filter::List::ConstIterator it;
for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos )
if ( name == (*it).name() )
return pos + 1;
return 0;
}
void ViewManager::initActions()
{
//US <ActionList name="view_loadedviews"/>
//US <Separator/>
#ifdef KAB_EMBEDDED
QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu();
QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu();
QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu();
#endif //KAB_EMBEDDED
mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" );
#if KDE_VERSION >= 309
mActionSelectView->setMenuAccelsEnabled( false );
#endif
connect( mActionSelectView, SIGNAL( activated( const QString& ) ),
SLOT( setActiveView( const QString& ) ) );
#ifdef KAB_EMBEDDED
mActionSelectView->plug(viewmenu);
viewmenu->insertSeparator();
#endif //KAB_EMBEDDED
diff --git a/kde2file/abdump/main.cpp b/kde2file/abdump/main.cpp
index 1ee64f5..9ad78e5 100644
--- a/kde2file/abdump/main.cpp
+++ b/kde2file/abdump/main.cpp
@@ -59,98 +59,96 @@ static KCmdLineOptions options[] =
{ "read",
I18N_NOOP( "Reads addressbook" ), 0 },
KCmdLineLastOption
};
int main( int argc, char *argv[] )
{
KAboutData aboutData(
progName, // internal program name
I18N_NOOP( progDisplay ), // displayable program name.
progVersion, // version string
I18N_NOOP( progDesc ), // short porgram description
KAboutData::License_GPL, // license type
"(c) 2004, Lutz Rogowski", // copyright statement
0, // any free form text
"", // program home page address
"bugs.kde.org" // bug report email address
);
// KCmdLineArgs::init() final 'true' argument indicates no commandline options
// for QApplication/KApplication (no KDE or Qt options)
KCmdLineArgs::init( argc, argv, &aboutData, true );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KInstance ins ( progName );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
bool read = false;
if ( args->isSet( "read" ) ) {
read = true;
qDebug("read ");
}
QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf";
KABC::StdAddressBook* standardAddressBook = KABC::StdAddressBook::self();
standardAddressBook->setAutomaticSave( false );
qDebug("************************************* ");
qDebug("***************kdeABdump************* ");
qDebug("************************************* ");
if ( !read ) {
KABC::AddressBook::Iterator it;
KABC::VCardConverter converter;
QString datastream;
for( it = standardAddressBook->begin(); it != standardAddressBook->end(); ++it ) {
if ( (*it).isEmpty() || ! (*it).resource() )
continue;
- if ( (*it).resource()->readOnly() )
- continue;
KABC::Addressee a = ( *it );
QString vcard = converter.createVCard( a );
vcard += QString("\r\n");
datastream += vcard;
}
QFile outFile(fileName);
if ( outFile.open(IO_WriteOnly) ) {
QTextStream t( &outFile ); // use a text stream
t.setEncoding( QTextStream::UnicodeUTF8 );
t <<datastream;
t << "\r\n\r\n";
outFile.close();
}
} else {
//Addressee::List aList;//parseVCards( const QString& vcard );
KABC::Addressee::List list;
int added = 0, changedC = 0, deleted = 0;
QFile file( fileName );
if ( file.open( IO_ReadOnly ) ) {
QTextStream t( &file ); // use a text stream
t.setEncoding( QTextStream::UnicodeUTF8 );
QString data;
data = t.read();
file.close();
KABC::VCardConverter converter;
list = converter.parseVCards( data );
qDebug("kdeABdump::file has %d entries", list.count());
KABC::Addressee::List::Iterator it;
for ( it = list.begin();it != list.end();++it) {
(*it).setChanged( true );
bool changed = ((*it).custom( "KADDRESSBOOK", "X-ExternalID" ) == "changed");
(*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" );
//qDebug("ext %s ", (*it).custom( "KADDRESSBOOK", "X-ExternalID" ).latin1());
if ( changed ) {
//qDebug("changed Addressee found! ");
KABC::Addressee std = standardAddressBook->findByUid( (*it).uid() );
if ( ! std.isEmpty() )
(*it).setResource(std.resource());
standardAddressBook->insertAddressee( (*it) );
++changedC;
} else {
//maybe added?
KABC::Addressee std = standardAddressBook->findByUid( (*it).uid() );
if ( std.isEmpty() ) {
standardAddressBook->insertAddressee( (*it) );
++added;
}
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp
index be1735b..08ccafb 100644
--- a/kde2file/caldump/main.cpp
+++ b/kde2file/caldump/main.cpp
@@ -84,97 +84,97 @@ int main( int argc, char *argv[] )
progName, // internal program name
I18N_NOOP( progDisplay ), // displayable program name.
progVersion, // version string
I18N_NOOP( progDesc ), // short porgram description
KAboutData::License_GPL, // license type
"(c) 2004, Lutz Rogowski", // copyright statement
0, // any free form text
"", // program home page address
"bugs.kde.org" // bug report email address
);
// KCmdLineArgs::init() final 'true' argument indicates no commandline options
// for QApplication/KApplication (no KDE or Qt options)
KCmdLineArgs::init( argc, argv, &aboutData, true );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KInstance ins ( progName );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
bool read = false;
if ( args->isSet( "read" ) ) {
read = true;
qDebug("read ");
}
QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics";
CalendarResources *calendarResource = 0;
CalendarLocal *localCalendar = 0;
KConfig c( locate( "config", "korganizerrc" ) );
c.setGroup( "Time & Date" );
QString tz = c.readEntry( "TimeZoneId" );
calendarResource = new CalendarResources( tz );
calendarResource->readConfig();
calendarResource->load();
qDebug("************************************* ");
qDebug("**************kdecaldump************* ");
qDebug("************************************* ");
qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1());
if ( !read ) {
localCalendar = new CalendarLocal();
localCalendar->setTimeZoneId( calendarResource->timeZoneId());
KCal::Incidence::List allInc = calendarResource->rawIncidences();
Incidence::List::ConstIterator it;
int num = 0;
for( it = allInc.begin(); it != allInc.end(); ++it ) {
ResourceCalendar * re = calendarResource->resource( (*it) );
- if ( re && !re->readOnly() ) {
+ if ( re && /*!re->readOnly() now readonly syncing possible */) {
++num;
Incidence* cl = (*it)->clone();
cl->setLastModified( (*it)->lastModified() );
if ( cl->type() == "Journal" )
localCalendar->addJournal( (Journal *) cl );
else if ( cl->type() == "Todo" )
localCalendar->addTodo( (Todo *) cl );
else if ( cl->type() == "Event" )
localCalendar->addEvent( (Event *) cl );
}
}
FileStorage* storage = new FileStorage( calendarResource );
storage->setFileName( fileName );
storage->setSaveFormat( new ICalFormat() );
storage->save();
delete storage;
qDebug("************************************* ");
qDebug("************kdecaldump*************** ");
qDebug("************************************* ");
qDebug("%d calendar entries dumped to file %s", num, fileName.latin1());
} else {
qDebug("************load");
localCalendar = new CalendarLocal();
localCalendar->setTimeZoneId( calendarResource->timeZoneId());
FileStorage* storage = new FileStorage( localCalendar );
storage->setFileName( fileName );
int num = 0;
int del = 0;
int add = 0;
if ( storage->load() ) {
qDebug("***********loaded!");
KCal::Incidence::List newInc = localCalendar->rawIncidences();
Incidence::List::ConstIterator it;
for( it = newInc.begin(); it != newInc.end(); ++it ) {
if ( (*it)->pilotId() > 1 ) { //changed
qDebug("*********pilot id %d %s ",(*it)->pilotId() ,(*it)->summary().latin1());
Incidence *incOld = calendarResource->incidence( (*it)->uid() );
ResourceCalendar * res = 0;
if ( incOld )
res = calendarResource->resource( incOld );
if ( res ) {
Incidence* cl = (*it)->clone();
cl->setPilotId( incOld->pilotId() );
++num;
if ( incOld->type() == "Journal" )
calendarResource->deleteJournal( (Journal *) incOld );
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 3d4acb7..f8bfc8b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -32,130 +32,132 @@
#include <qdialog.h>
#include <qtextstream.h>
#include <qdir.h>
#include <qregexp.h>
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kglobal.h>
#include <libkdepim/kpimglobalprefs.h>
#include <libkcal/calendar.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include <libkcal/vcalformat.h>
#include <libkcal/recurrence.h>
#include <libkcal/filestorage.h>
#include <libkdepim/categoryselectdialog.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koglobals.h"
#include "koprefs.h"
#include "kfiledialog.h"
#include "kolistview.h"
ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
{
mItem = item;
mDate = date;
}
ListItemVisitor::~ListItemVisitor()
{
}
bool ListItemVisitor::visit(Event *e)
{
bool ok = false;
QString start, end;
+ QDate ds, de;
if ( e->doesRecur() ) {
- QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
+ ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
if ( ok ) {
int days = e->dtStart().date().daysTo(e->dtEnd().date() );
- start = KGlobal::locale()->formatDate(d,true);
- end = KGlobal::locale()->formatDate(d.addDays( days),true);
+ start = KGlobal::locale()->formatDate(ds,true);
+ de = ds.addDays( days);
+ end = KGlobal::locale()->formatDate(de,true);
}
}
if ( ! ok ) {
start =e->dtStartDateStr();
end = e->dtEndDateStr();
+ ds = e->dtStart().date();
+ de = e->dtEnd().date();
}
mItem->setText(0,e->summary());
mItem->setText(1,start);
mItem->setText(2,e->dtStartTimeStr());
mItem->setText(3,end);
mItem->setText(4,e->dtEndTimeStr());
mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No"));
mItem->setText(6, e->recurrence()->recurrenceText());
mItem->setText(7,"---");
mItem->setText(8,"---");
mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No"));
mItem->setText(10,e->categoriesStr());
QString key;
- QDate d = e->dtStart().date();
QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
- key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute());
+ key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute());
mItem->setSortKey(1,key);
- d = e->dtEnd().date();
t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time();
- key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute());
+ key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute());
mItem->setSortKey(3,key);
return true;
}
bool ListItemVisitor::visit(Todo *t)
{
mItem->setText(0,i18n("To-Do: %1").arg(t->summary()));
if (t->hasStartDate()) {
mItem->setText(1,t->dtStartDateStr());
if (t->doesFloat()) {
mItem->setText(2,"---");
} else {
mItem->setText(2,t->dtStartTimeStr());
}
} else {
mItem->setText(1,"---");
mItem->setText(2,"---");
}
mItem->setText(3,"---");
mItem->setText(4,"---");
mItem->setText(5,"---");
mItem->setText(6,"---");
if (t->hasDueDate()) {
mItem->setText(7,t->dtDueDateStr());
if (t->doesFloat()) {
mItem->setText(8,"---");
} else {
mItem->setText(8,t->dtDueTimeStr());
}
} else {
mItem->setText(7,"---");
mItem->setText(8,"---");
}
mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No"));
mItem->setText(10,t->categoriesStr());
QString key;
QDate d;
if (t->hasDueDate()) {
d = t->dtDue().date();
QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time();
key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
mItem->setSortKey(7,key);
}
if ( t->hasStartDate() ) {
d = t->dtStart().date();
QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time();
diff --git a/version b/version
index 65eb8d1..d8563ed 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-version = "1.9.16";
+version = "1.9.17";