KoDocumentInfoDlg.cpp
1/* This file is part of the KDE project
2 Copyright (c) 2000 Simon Hausmann <hausmann@kde.org>
3
4 $Id: KoDocumentInfoDlg.cpp 512890 2006-02-23 21:37:08Z illissius $
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#include "KoDocumentInfoDlg.h"
23#include "KoDocumentInfo.h"
24#include "koDocumentInfoAboutWidget.h"
25#include "koDocumentInfoAuthorWidget.h"
26#include "koDocumentInfoUserMetadataWidget.h"
27#include "KoDocument.h"
28
29#include <KoGlobal.h>
30#include <KoStore.h>
31
32#include <sys/stat.h>
33#include <unistd.h>
34#include <assert.h>
35
36#include <tqlabel.h>
37#include <tqbuffer.h>
38#include <tqdom.h>
39#include <tqdir.h>
40#include <tqvbox.h>
41#include <tqdatetime.h>
42
43#include <tdeabc/addressee.h>
44#include <tdeabc/stdaddressbook.h>
45#include <tdeversion.h>
46#include <tdelocale.h>
47#include <tdemessagebox.h>
48#include <ktar.h>
49#include <kdebug.h>
50#include <tdetempfile.h>
51#include <kmimetype.h>
52#include <tqlayout.h>
53#include <tdelistview.h>
54#include <tqgrid.h>
55#include <tqmap.h>
56#include <kfilterdev.h>
57#include <klineedit.h>
58#include <ktextedit.h>
59#include <kiconloader.h>
60#include <kpushbutton.h>
61#include <tdelocale.h>
62
63class KoDocumentInfoDlg::KoDocumentInfoDlgPrivate
64{
65public:
66 KoDocumentInfoDlgPrivate()
67 {
68 }
69 ~KoDocumentInfoDlgPrivate()
70 {
71 }
72
73 KoDocumentInfo *m_info;
74 KoDocumentInfoAboutWidget *m_aboutWidget;
75 KoDocumentInfoAuthorWidget *m_authorWidget;
76 KoDocumentInfoUserMetadataWidget *m_metaWidget;
77
78 bool m_bDeleteDialog;
79 KDialogBase *m_dialog;
80};
81
82KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, TQWidget *parent, const char *name,
83 KDialogBase *dialog )
84: TQObject( parent, "docinfodlg" )
85{
86 d = new KoDocumentInfoDlgPrivate;
87 d->m_info = docInfo;
88
89 d->m_dialog = dialog;
90 d->m_bDeleteDialog = false;
91
92 if ( !dialog )
93 {
94 d->m_dialog = new KDialogBase( KDialogBase::Tabbed,
95 i18n( "Document Information" ),
97 KDialogBase::Ok, parent, name, true, false );
98 d->m_dialog->setInitialSize( TQSize( 500, 500 ) );
99 d->m_bDeleteDialog = true;
100 }
101
102 TQStringList pages = docInfo->pages();
103 TQStringList::ConstIterator it = pages.begin();
104 TQStringList::ConstIterator end = pages.end();
105 for (; it != end; ++it )
106 {
107 KoDocumentInfoPage *pg = docInfo->page( *it );
108 if ( pg->inherits( "KoDocumentInfoAuthor" ) )
109 addAuthorPage( static_cast<KoDocumentInfoAuthor *>( pg ) );
110 else if ( pg->inherits( "KoDocumentInfoAbout" ) )
111 addAboutPage( static_cast<KoDocumentInfoAbout *>( pg ) );
112/* else if ( pg->inherits( "KoDocumentInfoUserMetadata" ) )
113 addUserMetadataPage( static_cast<KoDocumentInfoUserMetadata *>( pg ) );*/
114 }
115}
116
117KoDocumentInfoDlg::~KoDocumentInfoDlg()
118{
119 if ( d->m_bDeleteDialog )
120 delete d->m_dialog;
121
122 delete d;
123}
124
125int KoDocumentInfoDlg::exec()
126{
127 return d->m_dialog->exec();
128}
129
130KDialogBase *KoDocumentInfoDlg::dialog() const
131{
132 return d->m_dialog;
133}
134
135void KoDocumentInfoDlg::loadFromKABC()
136{
137 TDEABC::StdAddressBook *ab = static_cast<TDEABC::StdAddressBook*>
138 ( TDEABC::StdAddressBook::self() );
139
140 if ( !ab )
141 return;
142
143 TDEABC::Addressee addr = ab->whoAmI();
144 if ( addr.isEmpty() )
145 {
146 KMessageBox::sorry( 0L, i18n( "No personal contact data set, please use the option \
147 \"Set as Personal Contact Data\" from the \"Edit\" menu in KAddressbook to set one." ) );
148 return;
149 }
150
151 d->m_authorWidget->leFullName->setText( addr.formattedName() );
152 d->m_authorWidget->leInitial->setText( addr.givenName()[ 0 ] + ". " +
153 addr.familyName()[ 0 ] + "." );
154 d->m_authorWidget->leAuthorTitle->setText( addr.title() );
155 d->m_authorWidget->leCompany->setText( addr.organization() );
156 d->m_authorWidget->leEmail->setText( addr.preferredEmail() );
157
158 TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Home );
159 d->m_authorWidget->leTelephoneHome->setText( phone.number() );
160 phone = addr.phoneNumber( TDEABC::PhoneNumber::Work );
161 d->m_authorWidget->leTelephoneWork->setText( phone.number() );
162
163 phone = addr.phoneNumber( TDEABC::PhoneNumber::Fax );
164 d->m_authorWidget->leFax->setText( phone.number() );
165
166 TDEABC::Address a = addr.address( TDEABC::Address::Home );
167 d->m_authorWidget->leCountry->setText( a.country() );
168 d->m_authorWidget->lePostalCode->setText( a.postalCode() );
169 d->m_authorWidget->leCity->setText( a.locality() );
170 d->m_authorWidget->leStreet->setText( a.street() );
171
172 emit changed();
173}
174
175void KoDocumentInfoDlg::deleteInfo()
176{
177 d->m_authorWidget->leFullName->setText( TQString() );
178 d->m_authorWidget->leInitial->setText( TQString() );
179 d->m_authorWidget->leAuthorTitle->setText( TQString() );
180 d->m_authorWidget->leCompany->setText( TQString() );
181 d->m_authorWidget->leEmail->setText( TQString() );
182 d->m_authorWidget->leTelephoneHome->setText( TQString() );
183 d->m_authorWidget->leTelephoneWork->setText( TQString() );
184 d->m_authorWidget->leFax->setText( TQString() );
185 d->m_authorWidget->leCountry->setText( TQString() );
186 d->m_authorWidget->lePostalCode->setText( TQString() );
187 d->m_authorWidget->leCity->setText( TQString() );
188 d->m_authorWidget->leStreet->setText( TQString() );
189 emit changed();
190}
191
192void KoDocumentInfoDlg::resetMetaData()
193{
194 TQString s = TDEGlobal::locale()->formatDateTime( TQDateTime::currentDateTime() );
195 d->m_aboutWidget->labelCreated->setText( s + ", " + d->m_info->creator() );
196 d->m_aboutWidget->labelModified->setText( "" );
197 d->m_aboutWidget->labelRevision->setText( "0" );
198 emit changed();
199}
200
201void KoDocumentInfoDlg::addAuthorPage( KoDocumentInfoAuthor *authorInfo )
202{
203 TQVBox *page = d->m_dialog->addVBoxPage( i18n( "Author" ) );
204 d->m_authorWidget = new KoDocumentInfoAuthorWidget( page );
205 d->m_authorWidget->labelAuthor->setPixmap( TDEGlobal::iconLoader()->loadIcon( "preferences-desktop-personal", TDEIcon::Desktop, 48 ) );
206 d->m_authorWidget->pbLoadKABC->setIconSet( TQIconSet( TDEGlobal::iconLoader()->loadIcon( "kaddressbook", TDEIcon::Small ) ) );
207 d->m_authorWidget->pbDelete->setIconSet( TQIconSet( TDEGlobal::iconLoader()->loadIcon( "eraser", TDEIcon::Small ) ) );
208
209 d->m_authorWidget->leFullName->setText( authorInfo->fullName() );
210 d->m_authorWidget->leInitial->setText( authorInfo->initial() );
211 d->m_authorWidget->leAuthorTitle->setText( authorInfo->title() );
212 d->m_authorWidget->leCompany->setText( authorInfo->company() );
213 d->m_authorWidget->leEmail->setText( authorInfo->email() );
214 d->m_authorWidget->leTelephoneWork->setText( authorInfo->telephoneWork() );
215 d->m_authorWidget->leTelephoneHome->setText( authorInfo->telephoneHome() );
216 d->m_authorWidget->leFax->setText( authorInfo->fax() );
217 d->m_authorWidget->leCountry->setText( authorInfo->country() );
218 d->m_authorWidget->lePostalCode->setText( authorInfo->postalCode() );
219 d->m_authorWidget->leCity->setText( authorInfo->city() );
220 d->m_authorWidget->leStreet->setText( authorInfo->street() );
221 d->m_authorWidget->leAuthorPosition->setText( authorInfo->position() );
222
223 connect( d->m_authorWidget->leFullName, TQ_SIGNAL( textChanged( const TQString & ) ),
224 this, TQ_SIGNAL( changed() ) );
225 connect( d->m_authorWidget->leInitial, TQ_SIGNAL( textChanged( const TQString & ) ),
226 this, TQ_SIGNAL( changed() ) );
227 connect( d->m_authorWidget->leAuthorTitle, TQ_SIGNAL( textChanged( const TQString & ) ),
228 this, TQ_SIGNAL( changed() ) );
229 connect( d->m_authorWidget->leCompany, TQ_SIGNAL( textChanged( const TQString & ) ),
230 this, TQ_SIGNAL( changed() ) );
231 connect( d->m_authorWidget->leEmail, TQ_SIGNAL( textChanged( const TQString & ) ),
232 this, TQ_SIGNAL( changed() ) );
233 connect( d->m_authorWidget->leTelephoneWork, TQ_SIGNAL( textChanged( const TQString & ) ),
234 this, TQ_SIGNAL( changed() ) );
235 connect( d->m_authorWidget->leTelephoneHome, TQ_SIGNAL( textChanged( const TQString & ) ),
236 this, TQ_SIGNAL( changed() ) );
237 connect( d->m_authorWidget->leFax, TQ_SIGNAL( textChanged( const TQString & ) ),
238 this, TQ_SIGNAL( changed() ) );
239 connect( d->m_authorWidget->leCountry, TQ_SIGNAL( textChanged( const TQString & ) ),
240 this, TQ_SIGNAL( changed() ) );
241 connect( d->m_authorWidget->lePostalCode, TQ_SIGNAL( textChanged( const TQString & ) ),
242 this, TQ_SIGNAL( changed() ) );
243 connect( d->m_authorWidget->leCity, TQ_SIGNAL( textChanged( const TQString & ) ),
244 this, TQ_SIGNAL( changed() ) );
245 connect( d->m_authorWidget->leStreet, TQ_SIGNAL( textChanged( const TQString & ) ),
246 this, TQ_SIGNAL( changed() ) );
247 connect( d->m_authorWidget->leAuthorPosition, TQ_SIGNAL( textChanged( const TQString & ) ),
248 this, TQ_SIGNAL( changed() ) );
249 connect( d->m_authorWidget->pbLoadKABC, TQ_SIGNAL( clicked() ),
250 this, TQ_SLOT( loadFromKABC() ) );
251 connect( d->m_authorWidget->pbDelete, TQ_SIGNAL( clicked() ),
252 this, TQ_SLOT( deleteInfo() ) );
253}
254
255void KoDocumentInfoDlg::addAboutPage( KoDocumentInfoAbout *aboutInfo )
256{
257 TQVBox *page = d->m_dialog->addVBoxPage( i18n( "General" ) );
258 d->m_aboutWidget = new KoDocumentInfoAboutWidget( page );
259 d->m_aboutWidget->pbReset->setIconSet( TQIconSet( TDEGlobal::iconLoader()->loadIcon( "reload", TDEIcon::Small ) ) );
260 KoDocument* doc = dynamic_cast< KoDocument* >( d->m_info->parent() );
261 if ( doc )
262 {
263 d->m_aboutWidget->leDocFile->setText( doc->file() );
264 d->m_aboutWidget->labelType->setText( KMimeType::mimeType( doc->mimeType() )->comment() );
265 d->m_aboutWidget->pixmapLabel->setPixmap( KMimeType::mimeType( doc->mimeType() )->pixmap( TDEIcon::Desktop, 48 ) );
266 }
267 if ( aboutInfo->creationDate() != TQString() )
268 d->m_aboutWidget->labelCreated->setText( aboutInfo->creationDate() + ", " + aboutInfo->initialCreator() );
269 if ( aboutInfo->modificationDate() != TQString() )
270 d->m_aboutWidget->labelModified->setText( aboutInfo->modificationDate() + ", " + d->m_info->creator() );
271 d->m_aboutWidget->labelRevision->setText( aboutInfo->editingCycles() );
272 d->m_aboutWidget->leDocTitle->setText( aboutInfo->title() );
273 d->m_aboutWidget->leDocSubject->setText( aboutInfo->subject() );
274 d->m_aboutWidget->leDocKeywords->setText( aboutInfo->keywords() );
275 d->m_aboutWidget->meDocAbstract->setText( aboutInfo->abstract() );
276
277 connect( d->m_aboutWidget->leDocTitle, TQ_SIGNAL( textChanged( const TQString & ) ),
278 this, TQ_SIGNAL( changed() ) );
279 connect( d->m_aboutWidget->meDocAbstract, TQ_SIGNAL( textChanged() ),
280 this, TQ_SIGNAL( changed() ) );
281 connect( d->m_aboutWidget->leDocSubject, TQ_SIGNAL( textChanged( const TQString & ) ),
282 this, TQ_SIGNAL( changed() ) );
283 connect( d->m_aboutWidget->leDocKeywords, TQ_SIGNAL( textChanged( const TQString & ) ),
284 this, TQ_SIGNAL( changed() ) );
285 connect( d->m_aboutWidget->pbReset, TQ_SIGNAL( clicked() ),
286 aboutInfo, TQ_SLOT( resetMetaData() ) );
287 connect( d->m_aboutWidget->pbReset, TQ_SIGNAL( clicked() ),
288 this, TQ_SLOT( resetMetaData() ) );
289}
290
291void KoDocumentInfoDlg::addUserMetadataPage( KoDocumentInfoUserMetadata *userMetadataInfo )
292{
293 TQVBox *page = d->m_dialog->addVBoxPage( i18n( "User-Defined Metadata" ) );
294 d->m_metaWidget = new KoDocumentInfoUserMetadataWidget( page );
295
296 d->m_metaWidget->metaListView->addColumn( "Name" );
297 d->m_metaWidget->metaListView->setFullWidth( true );
298
299 TQMap<TQString, TQString>::iterator it;
300 for ( it = userMetadataInfo->metadataList()->begin(); it != userMetadataInfo->metadataList()->end(); ++it )
301 {
302 TQString name = it.key();
303 TQString value = it.data();
304 TDEListViewItem* it = new TDEListViewItem( d->m_metaWidget->metaListView, name, value );
305 it->setPixmap( 0, TDEGlobal::iconLoader()->loadIcon( "text", TDEIcon::Small ) );
306 }
307}
308
309void KoDocumentInfoDlg::save()
310{
311 TQStringList pages = d->m_info->pages();
312 TQStringList::ConstIterator it = pages.begin();
313 TQStringList::ConstIterator end = pages.end();
314 bool saveInfo=false;
315 for (; it != end; ++it )
316 {
317 KoDocumentInfoPage *pg = d->m_info->page( *it );
318 if ( pg->inherits( "KoDocumentInfoAuthor" ) )
319 {
320 saveInfo=true;
321 save( static_cast<KoDocumentInfoAuthor *>( pg ) );
322 }
323 else if ( pg->inherits( "KoDocumentInfoAbout" ) )
324 {
325 saveInfo=true;
326 save( static_cast<KoDocumentInfoAbout *>( pg ) );
327 }
328 }
329 if(saveInfo)
330 d->m_info->documentInfochanged();
331}
332
333void KoDocumentInfoDlg::save( KoDocumentInfoAuthor *authorInfo )
334{
335 authorInfo->setFullName( d->m_authorWidget->leFullName->text() );
336 authorInfo->setInitial( d->m_authorWidget->leInitial->text() );
337 authorInfo->setTitle( d->m_authorWidget->leAuthorTitle->text() );
338 authorInfo->setCompany( d->m_authorWidget->leCompany->text() );
339 authorInfo->setEmail( d->m_authorWidget->leEmail->text() );
340 authorInfo->setTelephoneWork( d->m_authorWidget->leTelephoneWork->text() );
341 authorInfo->setTelephoneHome( d->m_authorWidget->leTelephoneHome->text() );
342 authorInfo->setFax( d->m_authorWidget->leFax->text() );
343 authorInfo->setCountry( d->m_authorWidget->leCountry->text() );
344 authorInfo->setPostalCode( d->m_authorWidget->lePostalCode->text() );
345 authorInfo->setCity( d->m_authorWidget->leCity->text() );
346 authorInfo->setStreet( d->m_authorWidget->leStreet->text() );
347 authorInfo->setPosition( d->m_authorWidget->leAuthorPosition->text() );
348
349 TDEConfig* config = KoGlobal::kofficeConfig();
350 TDEConfigGroupSaver cgs( config, "Author" );
351 config->writeEntry("telephone", d->m_authorWidget->leTelephoneHome->text());
352 config->writeEntry("telephone-work", d->m_authorWidget->leTelephoneWork->text());
353 config->writeEntry("fax", d->m_authorWidget->leFax->text());
354 config->writeEntry("country",d->m_authorWidget->leCountry->text());
355 config->writeEntry("postal-code",d->m_authorWidget->lePostalCode->text());
356 config->writeEntry("city", d->m_authorWidget->leCity->text());
357 config->writeEntry("street", d->m_authorWidget->leStreet->text());
358 config->sync();
359}
360
361void KoDocumentInfoDlg::save( KoDocumentInfoAbout *aboutInfo )
362{
363 aboutInfo->setTitle( d->m_aboutWidget->leDocTitle->text() );
364 aboutInfo->setSubject( d->m_aboutWidget->leDocSubject->text() );
365 aboutInfo->setKeywords( d->m_aboutWidget->leDocKeywords->text() );
366 aboutInfo->setAbstract( d->m_aboutWidget->meDocAbstract->text() );
367}
368
369void KoDocumentInfoDlg::save( KoDocumentInfoUserMetadata* )
370{
371 // FIXME
372}
373
374class KoDocumentInfoPropsPage::KoDocumentInfoPropsPagePrivate
375{
376public:
377 KoDocumentInfo *m_info;
378 KoDocumentInfoDlg *m_dlg;
379 KURL m_url;
380 KTarGz *m_src;
381 KTarGz *m_dst;
382
383 const KTarFile *m_docInfoFile;
384};
385
386KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props,
387 const char *,
388 const TQStringList & )
389: KPropsDlgPlugin( props )
390{
391 d = new KoDocumentInfoPropsPagePrivate;
392 d->m_info = new KoDocumentInfo( this, "docinfo" );
393 d->m_url = props->item()->url();
394 d->m_dlg = 0;
395
396 if ( !d->m_url.isLocalFile() )
397 return;
398
399 d->m_dst = 0;
400
401#ifdef __GNUC__
402#warning TODO port this to KoStore !!!
403#endif
404 d->m_src = new KTarGz( d->m_url.path(), "application/x-gzip" );
405
406 if ( !d->m_src->open( IO_ReadOnly ) )
407 return;
408
409 const KTarDirectory *root = d->m_src->directory();
410 if ( !root )
411 return;
412
413 const KTarEntry *entry = root->entry( "documentinfo.xml" );
414
415 if ( entry && entry->isFile() )
416 {
417 d->m_docInfoFile = static_cast<const KTarFile *>( entry );
418
419 TQBuffer buffer( d->m_docInfoFile->data() );
420 buffer.open( IO_ReadOnly );
421
422 TQDomDocument doc;
423 doc.setContent( &buffer );
424
425 d->m_info->load( doc );
426 }
427
428 d->m_dlg = new KoDocumentInfoDlg( d->m_info, 0, 0, props );
429 connect( d->m_dlg, TQ_SIGNAL( changed() ),
430 this, TQ_SIGNAL( changed() ) );
431}
432
433KoDocumentInfoPropsPage::~KoDocumentInfoPropsPage()
434{
435 delete d->m_info;
436 delete d->m_src;
437 delete d->m_dst;
438 delete d->m_dlg;
439 delete d;
440}
441
442void KoDocumentInfoPropsPage::applyChanges()
443{
444 const KTarDirectory *root = d->m_src->directory();
445 if ( !root )
446 return;
447
448 struct stat statBuff;
449
450 if ( stat( TQFile::encodeName( d->m_url.path() ), &statBuff ) != 0 )
451 return;
452
453 KTempFile tempFile( d->m_url.path(), TQString(), statBuff.st_mode );
454
455 tempFile.setAutoDelete( true );
456
457 if ( tempFile.status() != 0 )
458 return;
459
460 if ( !tempFile.close() )
461 return;
462
463 d->m_dst = new KTarGz( tempFile.name(), "application/x-gzip" );
464
465 if ( !d->m_dst->open( IO_WriteOnly ) )
466 return;
467
468 KMimeType::Ptr mimeType = KMimeType::findByURL( d->m_url, 0, true );
469 if ( mimeType && dynamic_cast<KFilterDev *>( d->m_dst->device() ) != 0 )
470 {
471 TQCString appIdentification( "KOffice " ); // We are limited in the number of chars.
472 appIdentification += mimeType->name().latin1();
473 appIdentification += '\004'; // Two magic bytes to make the identification
474 appIdentification += '\006'; // more reliable (DF)
475 d->m_dst->setOrigFileName( appIdentification );
476 }
477
478 bool docInfoSaved = false;
479
480 TQStringList entries = root->entries();
481 TQStringList::ConstIterator it = entries.begin();
482 TQStringList::ConstIterator end = entries.end();
483 for (; it != end; ++it )
484 {
485 const KTarEntry *entry = root->entry( *it );
486
487 assert( entry );
488
489 if ( entry->name() == "documentinfo.xml" ||
490 ( !docInfoSaved && !entries.contains( "documentinfo.xml" ) ) )
491 {
492 d->m_dlg->save();
493
494 TQBuffer buffer;
495 buffer.open( IO_WriteOnly );
496 TQTextStream str( &buffer );
497 str << d->m_info->save();
498 buffer.close();
499
500 kdDebug( 30003 ) << "writing documentinfo.xml" << endl;
501 d->m_dst->writeFile( "documentinfo.xml", entry->user(), entry->group(), buffer.buffer().size(),
502 buffer.buffer().data() );
503
504 docInfoSaved = true;
505 }
506 else
507 copy( TQString(), entry );
508 }
509
510 d->m_dst->close();
511
512 TQDir dir;
513 dir.rename( tempFile.name(), d->m_url.path() );
514
515 delete d->m_dst;
516 d->m_dst = 0;
517}
518
519void KoDocumentInfoPropsPage::copy( const TQString &path, const KArchiveEntry *entry )
520{
521 kdDebug( 30003 ) << "copy " << entry->name() << endl;
522 if ( entry->isFile() )
523 {
524 const KTarFile *file = static_cast<const KTarFile *>( entry );
525 kdDebug( 30003 ) << "file :" << entry->name() << endl;
526 kdDebug( 30003 ) << "full path is: " << path << entry->name() << endl;
527 d->m_dst->writeFile( path + entry->name(), entry->user(), entry->group(),
528 file->size(),
529 file->data().data() );
530 }
531 else
532 {
533 const KTarDirectory *dir = static_cast<const KTarDirectory *>( entry );
534 kdDebug( 30003 ) << "dir : " << entry->name() << endl;
535 kdDebug( 30003 ) << "full path is: " << path << entry->name() << endl;
536
537 TQString p = path + entry->name();
538 if ( p != "/" )
539 {
540 d->m_dst->writeDir( p, entry->user(), entry->group() );
541 p.append( "/" );
542 }
543
544 TQStringList entries = dir->entries();
545 TQStringList::ConstIterator it = entries.begin();
546 TQStringList::ConstIterator end = entries.end();
547 for (; it != end; ++it )
548 copy( p, dir->entry( *it ) );
549 }
550}
551
552#include "KoDocumentInfoDlg.moc"
static void sorry(TQWidget *parent, const TQString &text, const TQString &caption=TQString::null, int options=Notify)
The KOffice document class.
Definition KoDocument.h:61
TQString & file()
Only use these functions to restore m_file (in KoMainWindow) after a failed save (remember to use set...
Definition KoDocument.h:846
TQCString mimeType() const
Returns the actual mimetype of the document.
TDEAction * save(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)
TDEAction * copy(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)
const char * name(StdAction id)