--===============1481086663== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline --jq0ap7NbKX2Kqbes Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, the attached patch adds support for colored subresources in KOrganizer. Ok for commit? Ciao, Tobias --=20 Separate politics from religion and economy! The Councile of the European Union is an undemocratic and illegal instituti= on! --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="korg_color_subresources.patch" Content-Transfer-Encoding: quoted-printable Index: libkcal/resourcecalendar.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- libkcal/resourcecalendar.h (Revision 425030) +++ libkcal/resourcecalendar.h (Arbeitskopie) @@ -306,6 +306,14 @@ return resource; }; =20 + /** + Get the identifier of the subresource associated with a specified + incidence. + + @return the identifier of the subresource or an empty string. + */ + virtual QString subresourceIdentifier( Incidence *incidence ) { return= QString(); } + public slots: /** (De-)activate a subresource. Index: korganizer/koagenda.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- korganizer/koagenda.cpp (Revision 425030) +++ korganizer/koagenda.cpp (Arbeitskopie) @@ -1546,7 +1546,15 @@ =20 if ( calendarResource ) { ResourceCalendar *resourceCalendar =3D calendarResource->resource( inc= idence ); - resourceColor =3D *KOPrefs::instance()->resourceColor( resourceCalenda= r->identifier() ); + + QString identifier =3D resourceCalendar->identifier(); + if ( !resourceCalendar->subresources().isEmpty() ) { + identifier =3D resourceCalendar->subresourceIdentifier( incidence ); + if ( identifier.isEmpty() ) + identifier =3D resourceCalendar->identifier(); + } + + resourceColor =3D *KOPrefs::instance()->resourceColor( identifier ); // }else{ // kdDebug(5850) << "KOAgenda:insertItem: Calendar is not a CalendarRes= ources" <labelForSubreso= urce( *it ), - mView, this ); + ResourceItem *item =3D new ResourceItem( mResource, *it, mResource->= labelForSubresource( *it ), + mView, this ); + QColor resourceColor =3D *KOPrefs::instance()->resourceColor( *it ); + item->setResourceColor( resourceColor ); } } mSubItemsCreated =3D true; Index: korganizer/koprefsdialog.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- korganizer/koprefsdialog.cpp (Revision 425030) +++ korganizer/koprefsdialog.cpp (Arbeitskopie) @@ -823,9 +823,21 @@ kdDebug(5850) << "Loading Calendar resources...:" << endl; KCal::CalendarResourceManager::Iterator it; for( it =3D manager->begin(); it !=3D manager->end(); ++it ) { + if ( !(*it)->subresources().isEmpty() ) { + QStringList subresources =3D (*it)->subresources(); + for ( uint i =3D 0; i < subresources.count(); ++i ) { + QString resource =3D subresources[ i ]; + if ( (*it)->subresourceActive( resource ) ) { + mResourceCombo->insertItem( (*it)->labelForSubresource( resource= ) ); + mResourceIdentifier.append( resource ); + } + } + } + mResourceCombo->insertItem( (*it)->resourceName() ); mResourceIdentifier.append( (*it)->identifier() ); } + updateResourceColor(); } =20 Index: kresources/kolab/kcal/resourcekolab.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kresources/kolab/kcal/resourcekolab.cpp (Revision 425030) +++ kresources/kolab/kcal/resourcekolab.cpp (Arbeitskopie) @@ -863,6 +863,15 @@ return subresource; } =20 +QString ResourceKolab::subresourceIdentifier( Incidence *incidence ) +{ + QString uid =3D incidence->uid(); + if ( mUidMap.contains( uid ) ) + return mUidMap[ uid ].resource(); + else + return QString(); +} + void ResourceKolab::fromKMailAsyncLoadResult( const QMap& map, const QString& type, const QString& folder ) Index: kresources/kolab/kcal/resourcekolab.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kresources/kolab/kcal/resourcekolab.h (Revision 425030) +++ kresources/kolab/kcal/resourcekolab.h (Arbeitskopie) @@ -125,6 +125,8 @@ /** What is the label for this subresource? */ virtual const QString labelForSubresource( const QString& resource ) con= st; =20 + virtual QString subresourceIdentifier( Incidence *incidence ); + KABC::Lock* lock(); =20 signals: --tKW2IUtsqtDRztdT-- --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCun9YSvFUKpY6VLARAjvIAKCN9XXCRwS3eSAcUN7rH9fbXn0xgwCdGYCj DrUsmn1bASmpazTKwSY5w/k= =3Mxw -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes-- ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de --===============1481086663== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-pim mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/ --===============1481086663==-- ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de