summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-13 21:35:12 (UTC)
committer zautrix <zautrix>2004-09-13 21:35:12 (UTC)
commitbd6b4acb39498ffea3beea7d9b5f7620b60c14db (patch) (side-by-side diff)
treee2d7425b7bb49fbcb7acb5ced497ac1fed06dfaf
parent06eabf6e82c0390699d11fd12580d91261829431 (diff)
downloadkdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.zip
kdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.tar.gz
kdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.tar.bz2
Many bugfixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressee.cpp12
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp50
-rw-r--r--kaddressbook/mainembedded.cpp15
-rw-r--r--kaddressbook/nameeditdialog.cpp5
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp2
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--libkdepim/addresseeview.cpp10
-rw-r--r--libkdepim/kdateedit.cpp17
-rw-r--r--libkdepim/kdateedit.h3
-rw-r--r--microkde/kdeui/kaction.cpp44
10 files changed, 112 insertions, 48 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 6b282e2..4cdd5e5 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -796,45 +796,49 @@ QString Addressee::agentLabel()
void Addressee::setNameFromString( const QString &str )
{
setFormattedName( str );
setName( str );
- QStringList titles;
+ static bool first = true;
+ static QStringList titles;
+ static QStringList suffixes;
+ static QStringList prefixes;
+
+ if ( first ) {
+ first = false;
titles += i18n( "Dr." );
titles += i18n( "Miss" );
titles += i18n( "Mr." );
titles += i18n( "Mrs." );
titles += i18n( "Ms." );
titles += i18n( "Prof." );
- QStringList suffixes;
suffixes += i18n( "I" );
suffixes += i18n( "II" );
suffixes += i18n( "III" );
suffixes += i18n( "Jr." );
suffixes += i18n( "Sr." );
- QStringList prefixes;
prefixes += "van";
prefixes += "von";
prefixes += "de";
-//US KConfig config( "kabcrc" );
KConfig config( locateLocal( "config", "kabcrc") );
config.setGroup( "General" );
titles += config.readListEntry( "Prefixes" );
titles.remove( "" );
prefixes += config.readListEntry( "Inclusions" );
prefixes.remove( "" );
suffixes += config.readListEntry( "Suffixes" );
suffixes.remove( "" );
+ }
// clear all name parts
setPrefix( "" );
setGivenName( "" );
setAdditionalName( "" );
setFamilyName( "" );
setSuffix( "" );
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 3cfc1f2..826c69b 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -82,17 +82,16 @@
AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension,
QWidget *parent, const char *name )
: ExtensionWidget( core, parent, name ), mIsExtension( isExtension ),
mBlockSignals( false )
{
mAConfig = AddresseeConfig::instance();
- kdDebug(5720) << "AddresseeEditorWidget()" << endl;
mFormattedNameType = NameEditDialog::CustomName;
initGUI();
mCategoryDialog = 0;
mCategoryEditDialog = 0;
// Load the empty addressee as defaults
load();
@@ -627,16 +626,17 @@ void AddresseeEditorWidget::setupTab2()
label->setBuddy( mSpouseEdit );
//US layout->addWidget( mSpouseEdit, 5, 2 );
layout->addWidget( mSpouseEdit, 7, 2 );
label = new QLabel( i18n( "Birthday:" ), tab2 );
//US layout->addWidget( label, 4, 3 );
layout->addWidget( label, 8, 1 );
mBirthdayPicker = new KDateEdit( tab2 );
+ mBirthdayPicker->toggleDateFormat();
mBirthdayPicker->setHandleInvalid( true );
connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
#ifndef KAB_EMBEDDED
//US invalid dates are handdled by the KDateEdit widget itself
connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ),
@@ -942,17 +942,16 @@ void AddresseeEditorWidget::setupTab3_1()
layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
*/
mTabWidget->addTab( tab3, i18n( "&Images" ) );
}
void AddresseeEditorWidget::load()
{
- kdDebug(5720) << "AddresseeEditorWidget::load()" << endl;
// Block signals in case anything tries to emit modified
// CS: This doesn't seem to work.
bool block = signalsBlocked();
blockSignals( true );
mBlockSignals = true; // used for internal signal blocking
mNameEdit->setText( mAddressee.assembledName() );
@@ -1023,27 +1022,35 @@ void AddresseeEditorWidget::load()
blockSignals( block );
mBlockSignals = false;
mDirty = false;
}
void AddresseeEditorWidget::save()
{
- if ( !mDirty ) return;
+ if ( !dirty() ) {
+ return;
+ }
mAddressee.setRole( mRoleEdit->text() );
mAddressee.setOrganization( mOrgEdit->text() );
mAddressee.setUrl( KURL( mURLEdit->text() ) );
mAddressee.setNote( mNoteEdit->text() );
- if ( mBirthdayPicker->inputIsValid() )
- mAddressee.setBirthday( QDateTime( mBirthdayPicker->date() ) );
- else
+ if ( mBirthdayPicker->inputIsValid() ) {
+ QDate da = mBirthdayPicker->date();
+ if ( da > QDate::currentDate() )
+ da.setYMD(da.year()-100, da.month(), da.day() );
+ mAddressee.setBirthday( QDateTime( da ) );
+ qDebug("bday %s ",da.toString().latin1());
+ }
+ else {
mAddressee.setBirthday( QDateTime() );
-
+ mBirthdayPicker->clear();
+ }
mAddressee.setNickName( mNicknameEdit->text() );
mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) );
mAddressee.setGeo( mGeoWidget->geo() );
mAddressee.setPhoto( mImageWidget->photo() );
mAddressee.setLogo( mImageWidget->logo() );
mAddressee.setKeys( mKeyWidget->keys() );
#ifndef KAB_EMBEDDED
@@ -1057,24 +1064,23 @@ void AddresseeEditorWidget::save()
mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() );
if ( mAnniversaryPicker->inputIsValid() ) {
-
-//US mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary",
-//US mAnniversaryPicker->date().toString( Qt::ISODate ) );
QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate);
mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
}
- else
+ else {
mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" );
+ mAnniversaryPicker->clear();
+ }
// Save the email addresses
QStringList emails = mAddressee.emails();
QStringList::Iterator iter;
for ( iter = emails.begin(); iter != emails.end(); ++iter )
mAddressee.removeEmail( *iter );
emails = mEmailWidget->emails();
@@ -1109,16 +1115,36 @@ void AddresseeEditorWidget::save()
for ( addressIter = addresses.begin(); addressIter != addresses.end();
++addressIter )
mAddressee.insertAddress( *addressIter );
mDirty = false;
}
bool AddresseeEditorWidget::dirty()
{
+
+ if ( ! mDirty ) {
+ if ( mBirthdayPicker->inputIsValid() ) {
+ QDate da = mBirthdayPicker->date();
+ if ( !(da == mAddressee.birthday().date()))
+ mDirty = true;
+ }
+ else {
+ mBirthdayPicker->clear();
+ }
+ if ( mAnniversaryPicker->inputIsValid() ) {
+ QDate da = mAnniversaryPicker->date();
+ if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
+ "%Y-%m-%d"))
+ mDirty = true;
+ }
+ else {
+ mAnniversaryPicker->clear();
+ }
+ }
return mDirty;
}
void AddresseeEditorWidget::nameTextChanged( const QString &text )
{
// use the addressee class to parse the name for us
mAConfig->setUid( mAddressee.uid() );
if ( mAConfig->automaticNameParsing() ) {
@@ -1164,17 +1190,17 @@ void AddresseeEditorWidget::nameBoxChanged()
}
}
void AddresseeEditorWidget::nameButtonClicked()
{
// show the name dialog.
NameEditDialog dialog( mAddressee, mFormattedNameType, this );
- if ( dialog.exec() ) {
+ if ( KApplication::execDialog( &dialog) ) {
if ( dialog.changed() ) {
mAddressee.setFamilyName( dialog.familyName() );
mAddressee.setGivenName( dialog.givenName() );
mAddressee.setPrefix( dialog.prefix() );
mAddressee.setSuffix( dialog.suffix() );
mAddressee.setAdditionalName( dialog.additionalName() );
mFormattedNameType = dialog.formattedNameType();
if ( mFormattedNameType == NameEditDialog::CustomName ) {
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index d781f67..4230c07 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -66,16 +66,31 @@ int main( int argc, char **argv )
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
KAddressBookMain m ;
//US MainWindow m;
QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
+ {
+ KConfig kon ( locateLocal( "config", "korganizerrc" ) );
+ kon.setGroup("Locale");
+ KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
+ QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
+ KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) );
+ KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
+ dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
+ KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
+ kon.setGroup("Time & Date");
+ KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
+ kon.readNumEntry( "DaylightsavingStart", 90),
+ kon.readNumEntry( "DaylightsavingEnd",304) );
+ KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
+ }
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
a.exec();
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp
index fb7eb22..8213c2b 100644
--- a/kaddressbook/nameeditdialog.cpp
+++ b/kaddressbook/nameeditdialog.cpp
@@ -104,17 +104,17 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
mFormattedNameEdit = new KLineEdit( page );
mFormattedNameEdit->setEnabled( type == CustomName );
layout->addMultiCellWidget( mFormattedNameEdit, 5, 5, 1, 2 );
mParseBox = new QCheckBox( i18n( "Parse name automatically" ), page );
connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( parseBoxChanged(bool) ) );
connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) );
- layout->addMultiCellWidget( mParseBox, 6, 6, 0, 1 );
+ layout->addMultiCellWidget( mParseBox, 6, 6, 0, 2 );
// Fill in the values
mFamilyNameEdit->setText( addr.familyName() );
mGivenNameEdit->setText( addr.givenName() );
mAdditionalNameEdit->setText( addr.additionalName() );
mFormattedNameEdit->setText( addr.formattedName() );
// Prefix and suffix combos
@@ -170,19 +170,16 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( modified() ) );
connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
updateTypeCombo();
mFormattedNameCombo->setCurrentItem( type );
-#ifdef KAB_EMBEDDED
- resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300));
-#endif //KAB_EMBEDDED
mChanged = false;
}
NameEditDialog::~NameEditDialog()
{
}
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp
index ed591fc..c3a1627 100644
--- a/kmicromail/libmailwrapper/genericwrapper.cpp
+++ b/kmicromail/libmailwrapper/genericwrapper.cpp
@@ -32,16 +32,18 @@ QString Genericwrapper::parseDateTime( mailimf_date_time *date )
static bool init = false ;
if ( ! init ) {
KConfig kon ( locateLocal( "config", "korganizerrc" ) );
kon.setGroup("Locale");
KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) );
KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
+ dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
+ KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
kon.setGroup("Time & Date");
KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
kon.readNumEntry( "DaylightsavingStart", 90),
kon.readNumEntry( "DaylightsavingEnd",304) );
KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
init = true;
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index d5d31e2..258bd43 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1255,20 +1255,22 @@ void CalendarView::syncExternal( int mode )
syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs );
getEventViewerDialog()->setSyncMode( false );
qApp->processEvents();
if ( syncOK ) {
if ( KOPrefs::instance()->mWriteBackFile )
{
QPtrList<Incidence> iL = mCalendar->rawIncidences();
Incidence* inc = iL.first();
+ if ( phoneFormat ) {
while ( inc ) {
inc->removeID(mCurrentSyncDevice);
inc = iL.next();
}
+ }
#ifndef DESKTOP_VERSION
if ( sharpFormat )
sharpFormat->save(calendar);
#endif
if ( phoneFormat )
phoneFormat->save(calendar);
iL = calendar->rawIncidences();
inc = iL.first();
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp
index d710541..5c69010 100644
--- a/libkdepim/addresseeview.cpp
+++ b/libkdepim/addresseeview.cpp
@@ -60,17 +60,17 @@ AddresseeView::AddresseeView( QWidget *parent, const char *name )
//US QStyleSheet *sheet = styleSheet();
//US QStyleSheetItem *link = sheet->item( "a" );
//US link->setColor( KGlobalSettings::linkColor() );
}
void AddresseeView::setSource(const QString& n)
{
- qDebug("********AddresseeView::setSource %s", n.latin1());
+ //qDebug("********AddresseeView::setSource %s", n.latin1());
if ( n.left( 6 ) == "mailto" )
ExternalAppHandler::instance()->mailToOneContact( n.mid(7) );
else if ( n.left( 7 ) == "phoneto" )
ExternalAppHandler::instance()->callByPhone( n.mid(8) );
else if ( n.left( 5 ) == "faxto" )
ExternalAppHandler::instance()->callByFax( n.mid(6) );
else if ( n.left( 5 ) == "smsto" )
@@ -119,17 +119,23 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr )
dynamicPart += QString(
"<tr><td align=\"right\"><b>%1</b></td>"
"<td align=\"left\">%2</td></tr>" )
.arg( type )
.arg( *emailIt );
++emailIt;
}
}
-
+ if ( mAddressee.birthday().date().isValid() ) {
+ dynamicPart += QString(
+ "<tr><td align=\"right\"><b>%1</b></td>"
+ "<td align=\"left\">%2</td></tr>" )
+ .arg( i18n ("Birthday") )
+ .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) );
+ }
KABC::PhoneNumber::List phones = mAddressee.phoneNumbers();
KABC::PhoneNumber::List::ConstIterator phoneIt;
QString extension;
int phonetype;
QString sms;
for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
phonetype = (*phoneIt).type();
if (ksmsAvail &&
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index 5fb948a..c4c0081 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -119,17 +119,23 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
mHandleInvalid = false;
QWidget::setTabOrder( mDateEdit, mDateButton );
}
KDateEdit::~KDateEdit()
{
delete mDateFrame;
}
-
+void KDateEdit::clear()
+{
+ bool b = mDateEdit->signalsBlocked();
+ mDateEdit->blockSignals(true);
+ mDateEdit->setText("");
+ mDateEdit->blockSignals(b);
+}
void KDateEdit::setDate(QDate newDate)
{
if (!newDate.isValid() && !mHandleInvalid)
return;
if ( readDate() == newDate )
return;
QString dateString = "";
if(newDate.isValid())
@@ -458,26 +464,31 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e)
if ((e->type() == QEvent::FocusOut) && mTextChanged)
{
lineEnterPressed();
mTextChanged = false;
}
// switch dateFormShort by double klick with mouse
else if (e->type() == QEvent::MouseButtonDblClick)
{
- dateFormShort = dateFormShort?false:true;
- mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+ toggleDateFormat();
}
else if (e->type() == QEvent::FocusIn)
{
maxDay = readDate().day();
}
return false;
}
+void KDateEdit::toggleDateFormat()
+{
+ dateFormShort = ! dateFormShort;
+ mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+
+}
void KDateEdit::textChanged(const QString &)
{
if(mHandleInvalid && mDateEdit->text().stripWhiteSpace().isEmpty()) {
QDate date; //invalid date
emit(dateChanged(date));
} else {
mTextChanged = true;
diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h
index 742d843..cf3b90a 100644
--- a/libkdepim/kdateedit.h
+++ b/libkdepim/kdateedit.h
@@ -73,17 +73,18 @@ class KDateEdit : public QHBox
* of today will be returned.
*/
void setHandleInvalid(bool handleInvalid);
/** Checks for a focus out event. The display of the date is updated
* to display the proper date when the focus leaves.
*/
virtual bool eventFilter(QObject *o, QEvent *e);
-
+ void toggleDateFormat();
+ void clear();
signals:
/** This signal is emitted whenever the user modifies the date. This
* may not get emitted until the user presses enter in the line edit or
* focus leaves the widget (ie: the user confirms their selection).
*/
void dateChanged(QDate);
void returnPressed();
public slots:
diff --git a/microkde/kdeui/kaction.cpp b/microkde/kdeui/kaction.cpp
index 77d36a5..d38a6d5 100644
--- a/microkde/kdeui/kaction.cpp
+++ b/microkde/kdeui/kaction.cpp
@@ -207,17 +207,16 @@ KAction::KAction( QObject* parent, const char* name )
{
initPrivate( QString::null, KShortcut(), 0, 0 );
}
// KDE 4: remove end
KAction::~KAction()
{
- kdDebug(129) << "KAction::~KAction( this = \"" << name() << "\" )" << endl; // -- ellis
#ifndef KDE_NO_COMPAT
if (d->m_kaccel)
unplugAccel();
#endif
// If actionCollection hasn't already been destructed,
if ( m_parentCollection ) {
m_parentCollection->take( this );
@@ -430,17 +429,18 @@ bool KAction::setShortcut( const KShortcut& cut )
}
*/
return true;
}
bool KAction::updateKAccelShortcut( KAccel* kaccel )
{
- qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+ //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+
// Check if action is permitted
/*US
if (kapp && !kapp->authorizeKAction(name()))
return false;
bool b = true;
if ( !kaccel->actions().actionPtr( name() ) ) {
@@ -457,33 +457,35 @@ bool KAction::updateKAccelShortcut( KAccel* kaccel )
return b;
*/
return true;
}
void KAction::insertKAccel( KAccel* kaccel )
{
- qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+ //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+
/*US
//kdDebug(129) << "KAction::insertKAccel( " << kaccel << " ): this = " << this << endl;
if ( !kaccel->actions().actionPtr( name() ) ) {
if( updateKAccelShortcut( kaccel ) ) {
d->m_kaccelList.append( kaccel );
connect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
}
}
else
kdWarning(129) << "KAction::insertKAccel( kaccel = " << kaccel << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis
*/
}
void KAction::removeKAccel( KAccel* kaccel )
{
- qDebug("KAction::removeKAccel~ ...1 has top be fixed");
+ // qDebug("KAction::removeKAccel~ ...1 has top be fixed");
+
/*US
//kdDebug(129) << "KAction::removeKAccel( " << i << " ): this = " << this << endl;
for( uint i = 0; i < d->m_kaccelList.count(); i++ ) {
if( d->m_kaccelList[i] == kaccel ) {
kaccel->remove( name() );
d->m_kaccelList.remove( d->m_kaccelList.at( i ) );
disconnect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
break;
@@ -506,17 +508,18 @@ void KAction::updateShortcut( int i )
QWidget* w = container( i );
if ( w->inherits( "QPopupMenu" ) ) {
QPopupMenu* menu = static_cast<QPopupMenu*>(w);
updateShortcut( menu, id );
}
else if ( w->inherits( "QMenuBar" ) )
//US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id );
//US (QMenuBar*)(w)->setAccel( d->m_cut.keyCodeQt(), id );
- qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed");
+
+ ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed");
}
void KAction::updateShortcut( QPopupMenu* menu, int id )
{
/*US
//kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl;
// If the action has a KAccel object,
@@ -534,17 +537,19 @@ void KAction::updateShortcut( QPopupMenu* menu, int id )
// Otherwise insert the shortcut itself into the popup menu.
else {
// This is a fall-hack in case the KAction is missing a proper parent collection.
// It should be removed eventually. --ellis
menu->setAccel( d->m_cut.keyCodeQt(), id );
kdWarning(129) << "KAction::updateShortcut(): name = \"" << name() << "\", cut = " << d->m_cut.toStringInternal() << "; No KAccel, probably missing a parent collection." << endl;
}
*/
- qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed");
+
+
+//qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed");
}
const KShortcut& KAction::shortcut() const
{
return d->m_cut;
}
@@ -560,17 +565,17 @@ QString KAction::shortcutText() const
void KAction::setShortcutText( const QString& s )
{
setShortcut( KShortcut(s) );
}
int KAction::accel() const
{
- qDebug("KAction::accel() ...1 has top be fixed");
+ // qDebug("KAction::accel() ...1 has top be fixed");
//US return d->m_cut.keyCodeQt();
return 0;
}
void KAction::setGroup( const QString& grp )
{
d->m_group = grp;
@@ -596,27 +601,27 @@ bool KAction::isEnabled() const
bool KAction::isShortcutConfigurable() const
{
return d->m_configurable;
}
void KAction::setToolTip( const QString& tt )
{
- qDebug("KAction::setToolTip ...1 has top be fixed");
+ //qDebug("KAction::setToolTip ...1 has top be fixed");
d->setToolTip( tt );
int len = containerCount();
for( int i = 0; i < len; ++i )
updateToolTip( i );
}
void KAction::updateToolTip( int i )
{
- qDebug("KAction::updateToolTip ...1 has top be fixed");
+ //qDebug("KAction::updateToolTip ...1 has top be fixed");
QWidget *w = container( i );
if ( w->inherits( "KToolBar" ) )
QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
else if ( w->inherits( "QToolBar" ) )
QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
}
@@ -628,24 +633,17 @@ QString KAction::toolTip() const
int KAction::plug( QWidget *w, int index )
{
//kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl;
if (w == 0) {
kdWarning(129) << "KAction::plug called with 0 argument\n";
return -1;
}
-#ifndef NDEBUG
- KAccel* kaccel = kaccelCurrent();
- // If there is a shortcut, but no KAccel available
- if( !d->m_cut.isNull() && kaccel == 0 ) {
- kdWarning(129) << "KAction::plug(): has no KAccel object; this = " << this << " name = " << name() << " parentCollection = " << m_parentCollection << endl; // ellis
-//US kdDebug(129) << kdBacktrace() << endl;
- }
-#endif
+
// Check if action is permitted
//US if (kapp && !kapp->authorizeKAction(name()))
//US return -1;
plugShortcut();
if ( w->inherits("QPopupMenu") )
@@ -770,17 +768,18 @@ void KAction::unplug( QWidget *w )
removeContainer( i );
if ( m_parentCollection )
m_parentCollection->disconnectHighlight( w, this );
}
void KAction::plugAccel(KAccel *kacc, bool configurable)
{
- qDebug("KAction::plugAccel ...1 has top be fixed");
+ // qDebug("KAction::plugAccel ...1 has top be fixed");
+
/*US
kdWarning(129) << "KAction::plugAccel(): call to deprecated action." << endl;
kdDebug(129) << kdBacktrace() << endl;
//kdDebug(129) << "KAction::plugAccel( kacc = " << kacc << " ): name \"" << name() << "\"" << endl;
if ( d->m_kaccel )
unplugAccel();
// If the parent collection's accel ptr isn't set yet
@@ -801,30 +800,31 @@ void KAction::plugAccel(KAccel *kacc, bool configurable)
}
else
kdWarning(129) << "KAction::plugAccel( kacc = " << kacc << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis
*/
}
void KAction::unplugAccel()
{
- qDebug("KAction::unplugAccel ...1 has top be fixed");
+ // qDebug("KAction::unplugAccel ...1 has top be fixed");
/*US
//kdDebug(129) << "KAction::unplugAccel() " << this << " " << name() << endl;
if ( d->m_kaccel )
{
d->m_kaccel->remove(name());
d->m_kaccel = 0;
}
*/
}
void KAction::plugMainWindowAccel( QWidget *w )
{
- qDebug("KAction::plugMainWindowAccel ...1 has top be fixed");
+ // qDebug("KAction::plugMainWindowAccel ...1 has top be fixed");
+
/*US
// Note: topLevelWidget() stops too early, we can't use it.
QWidget * tl = w;
QWidget * n;
while ( !tl->isDialog() && ( n = tl->parentWidget() ) ) // lookup parent and store
tl = n;
KMainWindow * mw = dynamic_cast<KMainWindow *>(tl); // try to see if it's a kmainwindow
@@ -910,17 +910,17 @@ void KAction::updateText( int i )
int id = itemId( i );
static_cast<QPopupMenu*>(w)->changeItem( id, d->text() );
updateShortcut( static_cast<QPopupMenu*>(w), id );
}
else if ( w->inherits( "QMenuBar" ) )
static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() );
else if ( w->inherits( "KToolBar" ) )
{
- qDebug("KAction::updateText ...3 has top be fixed");
+ //qDebug("KAction::updateText ...3 has top be fixed");
QWidget *button = static_cast<KToolBar *>(w)->getWidget( itemId( i ) );
if ( button->inherits( "KToolBarButton" ) )
static_cast<KToolBarButton *>(button)->setText( d->plainText() );
}
}
QString KAction::text() const
@@ -1113,17 +1113,17 @@ void KAction::activate()
void KAction::slotActivated()
{
emit activated();
}
void KAction::slotDestroyed()
{
- kdDebug(129) << "KAction::slotDestroyed(): this = " << this << ", name = \"" << name() << "\", sender = " << sender() << endl;
+
const QObject* o = sender();
/*
// KDE 4: remove
if ( o == d->m_kaccel )
{