lib

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