• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
previewjob.cpp
1/* This file is part of the KDE libraries
2 Copyright (C) 2000 David Faure <faure@kde.org>
3 2000 Carsten Pfeiffer <pfeiffer@kde.org>
4 2001 Malte Starostik <malte.starostik@t-online.de>
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 "previewjob.h"
23
24#include <sys/stat.h>
25#ifdef __FreeBSD__
26 #include <machine/param.h>
27#endif
28#include <sys/types.h>
29
30#ifdef Q_OS_UNIX
31#include <sys/ipc.h>
32#include <sys/shm.h>
33#endif
34
35#include <tqdir.h>
36#include <tqfile.h>
37#include <tqimage.h>
38#include <tqtimer.h>
39#include <tqregexp.h>
40
41#include <kdatastream.h> // Do not remove, needed for correct bool serialization
42#include <tdefileitem.h>
43#include <tdeapplication.h>
44#include <tdetempfile.h>
45#include <ktrader.h>
46#include <kmdcodec.h>
47#include <tdeglobal.h>
48#include <tdestandarddirs.h>
49
50#include <tdeio/kservice.h>
51
52#include "previewjob.moc"
53
54namespace TDEIO { struct PreviewItem; }
55using namespace TDEIO;
56
57struct TDEIO::PreviewItem
58{
59 KFileItem *item;
60 KService::Ptr plugin;
61};
62
63struct TDEIO::PreviewJobPrivate
64{
65 enum { STATE_STATORIG, // if the thumbnail exists
66 STATE_GETORIG, // if we create it
67 STATE_CREATETHUMB // thumbnail:/ slave
68 } state;
69 KFileItemList initialItems;
70 const TQStringList *enabledPlugins;
71 // Our todo list :)
72 TQValueList<PreviewItem> items;
73 // The current item
74 PreviewItem currentItem;
75 // The modification time of that URL
76 time_t tOrig;
77 // Path to thumbnail cache for the current size
78 TQString thumbPath;
79 // Original URL of current item in TMS format
80 // (file:///path/to/file instead of file:/path/to/file)
81 TQString origName;
82 // Thumbnail file name for current item
83 TQString thumbName;
84 // Size of thumbnail
85 int width;
86 int height;
87 // Unscaled size of thumbnail (128 or 256 if cache is enabled)
88 int cacheWidth;
89 int cacheHeight;
90 // Whether the thumbnail should be scaled
91 bool bScale;
92 // Whether we should save the thumbnail
93 bool bSave;
94 // If the file to create a thumb for was a temp file, this is its name
95 TQString tempName;
96 // Over that, it's too much
97 unsigned long maximumSize;
98 // the size for the icon overlay
99 int iconSize;
100 // the transparency of the blended mimetype icon
101 int iconAlpha;
102 // Shared memory segment Id. The segment is allocated to a size
103 // of extent x extent x 4 (32 bit image) on first need.
104 int shmid;
105 // And the data area
106 uchar *shmaddr;
107 // Delete the KFileItems when done?
108 bool deleteItems;
109 bool succeeded;
110 // Root of thumbnail cache
111 TQString thumbRoot;
112 bool ignoreMaximumSize;
113 TQTimer startPreviewTimer;
114};
115
116PreviewJob::PreviewJob( const KFileItemList &items, int width, int height,
117 int iconSize, int iconAlpha, bool scale, bool save,
118 const TQStringList *enabledPlugins, bool deleteItems )
119 : TDEIO::Job( false /* no GUI */ )
120{
121 d = new PreviewJobPrivate;
122 d->tOrig = 0;
123 d->shmid = -1;
124 d->shmaddr = 0;
125 d->initialItems = items;
126 d->enabledPlugins = enabledPlugins;
127 d->width = width;
128 d->height = height ? height : width;
129 d->cacheWidth = d->width;
130 d->cacheHeight = d->height;
131 d->iconSize = iconSize;
132 d->iconAlpha = iconAlpha;
133 d->deleteItems = deleteItems;
134 d->bScale = scale;
135 d->bSave = save && scale;
136 d->succeeded = false;
137 d->currentItem.item = 0;
138 d->thumbRoot = TQDir::homeDirPath() + "/.thumbnails/";
139 d->ignoreMaximumSize = false;
140
141 // Return to event loop first, determineNextFile() might delete this;
142 connect(&d->startPreviewTimer, TQ_SIGNAL(timeout()), TQ_SLOT(startPreview()) );
143 d->startPreviewTimer.start(0, true);
144}
145
146PreviewJob::~PreviewJob()
147{
148#ifdef Q_OS_UNIX
149 if (d->shmaddr) {
150 shmdt((char*)d->shmaddr);
151 shmctl(d->shmid, IPC_RMID, 0);
152 }
153#endif
154 delete d;
155}
156
157void PreviewJob::startPreview()
158{
159 // Load the list of plugins to determine which mimetypes are supported
160 TDETrader::OfferList plugins = TDETrader::self()->query("ThumbCreator");
161 TQMap<TQString, KService::Ptr> mimeMap;
162
163 for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
164 if (!d->enabledPlugins || d->enabledPlugins->contains((*it)->desktopEntryName()))
165 {
166 TQStringList mimeTypes = (*it)->property("MimeTypes").toStringList();
167 for (TQStringList::ConstIterator mt = mimeTypes.begin(); mt != mimeTypes.end(); ++mt)
168 mimeMap.insert(*mt, *it);
169 }
170
171 // Look for images and store the items in our todo list :)
172 bool bNeedCache = false;
173 for (KFileItemListIterator it(d->initialItems); it.current(); ++it )
174 {
175 PreviewItem item;
176 item.item = it.current();
177 TQMap<TQString, KService::Ptr>::ConstIterator plugin = mimeMap.find(it.current()->mimetype());
178 if (plugin == mimeMap.end()
179 && (it.current()->mimetype() != "application/x-desktop")
180 && (it.current()->mimetype() != "media/builtin-mydocuments")
181 && (it.current()->mimetype() != "media/builtin-mycomputer")
182 && (it.current()->mimetype() != "media/builtin-mynetworkplaces")
183 && (it.current()->mimetype() != "media/builtin-printers")
184 && (it.current()->mimetype() != "media/builtin-trash")
185 && (it.current()->mimetype() != "media/builtin-webbrowser"))
186 {
187 TQString mimeType = it.current()->mimetype();
188 plugin = mimeMap.find(mimeType.replace(TQRegExp("/.*"), "/*"));
189
190 if (plugin == mimeMap.end())
191 {
192 // check mime type inheritance
193 KMimeType::Ptr mimeInfo = KMimeType::mimeType(it.current()->mimetype());
194 TQString parentMimeType = mimeInfo->parentMimeType();
195 while (!parentMimeType.isEmpty())
196 {
197 plugin = mimeMap.find(parentMimeType);
198 if (plugin != mimeMap.end()) break;
199
200 KMimeType::Ptr parentMimeInfo = KMimeType::mimeType(parentMimeType);
201 if (!parentMimeInfo) break;
202
203 parentMimeType = parentMimeInfo->parentMimeType();
204 }
205 }
206
207 if (plugin == mimeMap.end())
208 {
209 // check X-TDE-Text property
210 KMimeType::Ptr mimeInfo = KMimeType::mimeType(it.current()->mimetype());
211 TQVariant textProperty = mimeInfo->property("X-TDE-text");
212 if (textProperty.isValid() && textProperty.type() == TQVariant::Bool)
213 {
214 if (textProperty.toBool())
215 {
216 plugin = mimeMap.find("text/plain");
217 if (plugin == mimeMap.end())
218 {
219 plugin = mimeMap.find( "text/*" );
220 }
221 }
222 }
223 }
224 }
225
226 if (plugin != mimeMap.end())
227 {
228 item.plugin = *plugin;
229 d->items.append(item);
230 if (!bNeedCache && d->bSave &&
231 (it.current()->url().protocol() != "file" ||
232 !it.current()->url().directory( false ).startsWith(d->thumbRoot)) &&
233 (*plugin)->property("CacheThumbnail").toBool())
234 bNeedCache = true;
235 }
236 else
237 {
238 emitFailed(it.current());
239 if (d->deleteItems)
240 delete it.current();
241 }
242 }
243
244 // Read configuration value for the maximum allowed size
245 TDEConfig * config = TDEGlobal::config();
246 TDEConfigGroupSaver cgs( config, "PreviewSettings" );
247 d->maximumSize = config->readNumEntry( "MaximumSize", 1024*1024 /* 1MB */ );
248
249 if (bNeedCache)
250 {
251 if (d->width <= 128 && d->height <= 128) d->cacheWidth = d->cacheHeight = 128;
252 else d->cacheWidth = d->cacheHeight = 256;
253 d->thumbPath = d->thumbRoot + (d->cacheWidth == 128 ? "normal/" : "large/");
254 TDEStandardDirs::makeDir(d->thumbPath, 0700);
255 }
256 else
257 d->bSave = false;
258 determineNextFile();
259}
260
261void PreviewJob::removeItem( const KFileItem *item )
262{
263 for (TQValueList<PreviewItem>::Iterator it = d->items.begin(); it != d->items.end(); ++it)
264 if ((*it).item == item)
265 {
266 d->items.remove(it);
267 break;
268 }
269
270 if (d->currentItem.item == item)
271 {
272 subjobs.first()->kill();
273 subjobs.removeFirst();
274 determineNextFile();
275 }
276}
277
278void PreviewJob::setIgnoreMaximumSize(bool ignoreSize)
279{
280 d->ignoreMaximumSize = ignoreSize;
281}
282
283void PreviewJob::determineNextFile()
284{
285 if (d->currentItem.item)
286 {
287 if (!d->succeeded)
288 emitFailed();
289 if (d->deleteItems) {
290 delete d->currentItem.item;
291 d->currentItem.item = 0L;
292 }
293 }
294 // No more items ?
295 if ( d->items.isEmpty() )
296 {
297 emitResult();
298 return;
299 }
300 else
301 {
302 // First, stat the orig file
303 d->state = PreviewJobPrivate::STATE_STATORIG;
304 d->currentItem = d->items.first();
305 d->succeeded = false;
306 d->items.remove(d->items.begin());
307 TDEIO::Job *job = TDEIO::stat( d->currentItem.item->url(), false );
308 job->addMetaData( "no-auth-prompt", "true" );
309 addSubjob(job);
310 }
311}
312
313void PreviewJob::slotResult( TDEIO::Job *job )
314{
315 subjobs.remove( job );
316 Q_ASSERT ( subjobs.isEmpty() ); // We should have only one job at a time ...
317 switch ( d->state )
318 {
319 case PreviewJobPrivate::STATE_STATORIG:
320 {
321 if (job->error()) // that's no good news...
322 {
323 // Drop this one and move on to the next one
324 determineNextFile();
325 return;
326 }
327 TDEIO::UDSEntry entry = ((TDEIO::StatJob*)job)->statResult();
328 TDEIO::UDSEntry::ConstIterator it = entry.begin();
329 d->tOrig = 0;
330 int found = 0;
331 for( ; it != entry.end() && found < 2; it++ )
332 {
333 if ( (*it).m_uds == TDEIO::UDS_MODIFICATION_TIME )
334 {
335 d->tOrig = (time_t)((*it).m_long);
336 found++;
337 }
338 else if ( (*it).m_uds == TDEIO::UDS_SIZE )
339 {
340 if ( filesize_t((*it).m_long) > d->maximumSize &&
341 !d->ignoreMaximumSize &&
342 !d->currentItem.plugin->property("IgnoreMaximumSize").toBool() )
343 {
344 determineNextFile();
345 return;
346 }
347 found++;
348 }
349 }
350
351 if ( !d->currentItem.plugin->property( "CacheThumbnail" ).toBool() )
352 {
353 // This preview will not be cached, no need to look for a saved thumbnail
354 // Just create it, and be done
355 getOrCreateThumbnail();
356 return;
357 }
358
359 if ( statResultThumbnail() )
360 return;
361
362 getOrCreateThumbnail();
363 return;
364 }
365 case PreviewJobPrivate::STATE_GETORIG:
366 {
367 if (job->error())
368 {
369 determineNextFile();
370 return;
371 }
372
373 createThumbnail( static_cast<TDEIO::FileCopyJob*>(job)->destURL().path() );
374 return;
375 }
376 case PreviewJobPrivate::STATE_CREATETHUMB:
377 {
378 if (!d->tempName.isEmpty())
379 {
380 TQFile::remove(d->tempName);
381 d->tempName = TQString::null;
382 }
383 determineNextFile();
384 return;
385 }
386 }
387}
388
389bool PreviewJob::statResultThumbnail()
390{
391 if ( d->thumbPath.isEmpty() )
392 return false;
393
394 KURL url = d->currentItem.item->url();
395 // Don't include the password if any
396 url.setPass(TQString::null);
397 // The TMS defines local files as file:///path/to/file instead of KDE's
398 // way (file:/path/to/file)
399#ifdef KURL_TRIPLE_SLASH_FILE_PROT
400 d->origName = url.url();
401#else
402 if (url.protocol() == "file") d->origName = "file://" + url.path();
403 else d->origName = url.url();
404#endif
405
406 KMD5 md5( TQFile::encodeName( d->origName ).data() );
407 d->thumbName = TQFile::encodeName( md5.hexDigest() ) + ".png";
408
409 TQImage thumb;
410 if ( !thumb.load( d->thumbPath + d->thumbName ) ) return false;
411
412 if ( thumb.text( "Thumb::URI", 0 ) != d->origName ||
413 thumb.text( "Thumb::MTime", 0 ).toInt() != d->tOrig ) return false;
414
415 // Found it, use it
416 emitPreview( thumb );
417 d->succeeded = true;
418 determineNextFile();
419 return true;
420}
421
422
423void PreviewJob::getOrCreateThumbnail()
424{
425 // We still need to load the orig file ! (This is getting tedious) :)
426 const KFileItem* item = d->currentItem.item;
427 const TQString localPath = item->localPath();
428 if ( !localPath.isEmpty() )
429 createThumbnail( localPath );
430 else
431 {
432 d->state = PreviewJobPrivate::STATE_GETORIG;
433 KTempFile localFile;
434 KURL localURL;
435 localURL.setPath( d->tempName = localFile.name() );
436 const KURL currentURL = item->url();
437 TDEIO::Job * job = TDEIO::file_copy( currentURL, localURL, -1, true,
438 false, false /* No GUI */ );
439 job->addMetaData("thumbnail","1");
440 addSubjob(job);
441 }
442}
443
444// KDE 4: Make it const TQString &
445void PreviewJob::createThumbnail( TQString pixPath )
446{
447 d->state = PreviewJobPrivate::STATE_CREATETHUMB;
448 KURL thumbURL;
449 thumbURL.setProtocol("thumbnail");
450 thumbURL.setPath(pixPath);
451 TDEIO::TransferJob *job = TDEIO::get(thumbURL, false, false);
452 addSubjob(job);
453 connect(job, TQ_SIGNAL(data(TDEIO::Job *, const TQByteArray &)), TQ_SLOT(slotThumbData(TDEIO::Job *, const TQByteArray &)));
454 bool save = d->bSave && d->currentItem.plugin->property("CacheThumbnail").toBool();
455 job->addMetaData("mimeType", d->currentItem.item->mimetype());
456 job->addMetaData("width", TQString().setNum(save ? d->cacheWidth : d->width));
457 job->addMetaData("height", TQString().setNum(save ? d->cacheHeight : d->height));
458 job->addMetaData("iconSize", TQString().setNum(save ? 64 : d->iconSize));
459 job->addMetaData("iconAlpha", TQString().setNum(d->iconAlpha));
460 job->addMetaData("plugin", d->currentItem.plugin->library());
461#ifdef Q_OS_UNIX
462 if (d->shmid == -1)
463 {
464 if (d->shmaddr) {
465 shmdt((char*)d->shmaddr);
466 shmctl(d->shmid, IPC_RMID, 0);
467 }
468 d->shmid = shmget(IPC_PRIVATE, d->cacheWidth * d->cacheHeight * 4, IPC_CREAT|0600);
469 if (d->shmid != -1)
470 {
471 d->shmaddr = (uchar *)(shmat(d->shmid, 0, SHM_RDONLY));
472 if (d->shmaddr == (uchar *)-1)
473 {
474 shmctl(d->shmid, IPC_RMID, 0);
475 d->shmaddr = 0;
476 d->shmid = -1;
477 }
478 }
479 else
480 d->shmaddr = 0;
481 }
482 if (d->shmid != -1)
483 job->addMetaData("shmid", TQString().setNum(d->shmid));
484#endif
485}
486
487void PreviewJob::slotThumbData(TDEIO::Job *, const TQByteArray &data)
488{
489 bool save = d->bSave &&
490 d->currentItem.plugin->property("CacheThumbnail").toBool() &&
491 (d->currentItem.item->url().protocol() != "file" ||
492 !d->currentItem.item->url().directory( false ).startsWith(d->thumbRoot));
493 TQImage thumb;
494#ifdef Q_OS_UNIX
495 if (d->shmaddr)
496 {
497 TQDataStream str(data, IO_ReadOnly);
498 int width, height, depth;
499 bool alpha;
500 str >> width >> height >> depth >> alpha;
501 thumb = TQImage(d->shmaddr, width, height, depth, 0, 0, TQImage::IgnoreEndian);
502 thumb.setAlphaBuffer(alpha);
503 }
504 else
505#endif
506 thumb.loadFromData(data);
507
508 if (save)
509 {
510 thumb.setText("Thumb::URI", 0, d->origName);
511 thumb.setText("Thumb::MTime", 0, TQString::number(d->tOrig));
512 thumb.setText("Thumb::Size", 0, number(d->currentItem.item->size()));
513 thumb.setText("Thumb::Mimetype", 0, d->currentItem.item->mimetype());
514 thumb.setText("Software", 0, "KDE Thumbnail Generator");
515 KTempFile temp(d->thumbPath + "kde-tmp-", ".png");
516 if (temp.status() == 0) //Only try to write out the thumbnail if we
517 { //actually created the temp file.
518 thumb.save(temp.name(), "PNG");
519 rename(TQFile::encodeName(temp.name()), TQFile::encodeName(d->thumbPath + d->thumbName));
520 }
521 }
522 emitPreview( thumb );
523 d->succeeded = true;
524}
525
526void PreviewJob::emitPreview(const TQImage &thumb)
527{
528 TQPixmap pix;
529 if (thumb.width() > d->width || thumb.height() > d->height)
530 {
531 double imgRatio = (double)thumb.height() / (double)thumb.width();
532 if (imgRatio > (double)d->height / (double)d->width)
533 pix.convertFromImage(
534 thumb.smoothScale((int)TQMAX((double)d->height / imgRatio, 1), d->height));
535 else pix.convertFromImage(
536 thumb.smoothScale(d->width, (int)TQMAX((double)d->width * imgRatio, 1)));
537 }
538 else pix.convertFromImage(thumb);
539 emit gotPreview(d->currentItem.item, pix);
540}
541
542void PreviewJob::emitFailed(const KFileItem *item)
543{
544 if (!item)
545 item = d->currentItem.item;
546 emit failed(item);
547}
548
549TQStringList PreviewJob::availablePlugins()
550{
551 TQStringList result;
552 TDETrader::OfferList plugins = TDETrader::self()->query("ThumbCreator");
553 for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
554 if (!result.contains((*it)->desktopEntryName()))
555 result.append((*it)->desktopEntryName());
556 return result;
557}
558
559TQStringList PreviewJob::supportedMimeTypes()
560{
561 TQStringList result;
562 TDETrader::OfferList plugins = TDETrader::self()->query("ThumbCreator");
563 for (TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it)
564 result += (*it)->property("MimeTypes").toStringList();
565 return result;
566}
567
568void PreviewJob::kill( bool quietly )
569{
570 d->startPreviewTimer.stop();
571 Job::kill( quietly );
572}
573
574PreviewJob *TDEIO::filePreview( const KFileItemList &items, int width, int height,
575 int iconSize, int iconAlpha, bool scale, bool save,
576 const TQStringList *enabledPlugins )
577{
578 return new PreviewJob(items, width, height, iconSize, iconAlpha,
579 scale, save, enabledPlugins);
580}
581
582PreviewJob *TDEIO::filePreview( const KURL::List &items, int width, int height,
583 int iconSize, int iconAlpha, bool scale, bool save,
584 const TQStringList *enabledPlugins )
585{
586 KFileItemList fileItems;
587 for (KURL::List::ConstIterator it = items.begin(); it != items.end(); ++it)
588 fileItems.append(new KFileItem(KFileItem::Unknown, KFileItem::Unknown, *it, true));
589 return new PreviewJob(fileItems, width, height, iconSize, iconAlpha,
590 scale, save, enabledPlugins, true);
591}
592
593void PreviewJob::virtual_hook( int id, void* data )
594{ TDEIO::Job::virtual_hook( id, data ); }
595
KFileItem
A KFileItem is a generic class to handle a file, local or remote.
Definition tdefileitem.h:42
KFileItem::url
const KURL & url() const
Returns the url of the file.
Definition tdefileitem.h:113
KFileItem::localPath
TQString localPath() const
Returns the local path if isLocalFile() == true or the TDEIO item has a UDS_LOCAL_PATH atom.
Definition tdefileitem.cpp:355
KMimeType::mimeType
static Ptr mimeType(const TQString &_name)
Retrieve a pointer to the mime type _name or a pointer to the default mime type "application/octet-st...
Definition kmimetype.cpp:141
TDEIO::FileCopyJob
The FileCopyJob copies data from one place to another.
Definition jobclasses.h:1249
TDEIO::Job
The base class for all jobs.
Definition jobclasses.h:67
TDEIO::Job::emitResult
void emitResult()
Utility function to emit the result signal, and suicide this job.
Definition job.cpp:249
TDEIO::Job::addSubjob
virtual void addSubjob(Job *job, bool inheritMetaData=true)
Definition job.cpp:183
TDEIO::Job::result
void result(TDEIO::Job *job)
TDEIO::Job::kill
virtual void kill(bool quietly=true)
Abort this job.
Definition job.cpp:260
TDEIO::Job::addMetaData
void addMetaData(const TQString &key, const TQString &value)
Definition job.cpp:434
TDEIO::Job::error
int error() const
Returns the error code, if there has been an error.
Definition jobclasses.h:94
TDEIO::PreviewJob
TDEIO Job to get a thumbnail picture.
Definition previewjob.h:36
TDEIO::PreviewJob::supportedMimeTypes
static TQStringList supportedMimeTypes()
Definition previewjob.cpp:559
TDEIO::PreviewJob::failed
void failed(const KFileItem *item)
TDEIO::PreviewJob::gotPreview
void gotPreview(const KFileItem *item, const TQPixmap &preview)
TDEIO::PreviewJob::kill
virtual void kill(bool quietly=true)
Reimplemented for internal reasons.
Definition previewjob.cpp:568
TDEIO::PreviewJob::removeItem
void removeItem(const KFileItem *item)
Removes an item from preview processing.
Definition previewjob.cpp:261
TDEIO::PreviewJob::PreviewJob
PreviewJob(const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, const TQStringList *enabledPlugins, bool deleteItems=false)
Creates a new PreviewJob.
Definition previewjob.cpp:116
TDEIO::PreviewJob::availablePlugins
static TQStringList availablePlugins()
Definition previewjob.cpp:549
TDEIO::PreviewJob::setIgnoreMaximumSize
void setIgnoreMaximumSize(bool ignoreSize=true)
If ignoreSize is true, then the preview is always generated regardless of the settings.
Definition previewjob.cpp:278
TDEIO::StatJob
A TDEIO job that retrieves information about a file or directory.
Definition jobclasses.h:687
TDEIO::TransferJob
The transfer job pumps data into and/or out of a Slave.
Definition jobclasses.h:874
TDETrader::query
virtual OfferList query(const TQString &servicetype, const TQString &constraint=TQString::null, const TQString &preferences=TQString::null) const
The main function in the TDETrader class.
Definition ktrader.cpp:106
TDETrader::self
static TDETrader * self()
This is a static pointer to a TDETrader instance.
Definition ktrader.cpp:90
TDETrader::OfferList
TQValueList< KService::Ptr > OfferList
A list of services.
Definition ktrader.h:92
TDEIO
A namespace for TDEIO globals.
Definition authinfo.h:29
TDEIO::number
TDEIO_EXPORT TQString number(TDEIO::filesize_t size)
Converts a size to a string representation Not unlike TQString::number(...)
Definition global.cpp:96
TDEIO::file_copy
TDEIO_EXPORT FileCopyJob * file_copy(const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, bool showProgressInfo=true)
Copy a single file.
Definition job.cpp:2027
TDEIO::localURL
TDEIO_EXPORT LocalURLJob * localURL(const KURL &remoteUrl)
Retrieve local URL if available.
Definition job.cpp:870
TDEIO::UDS_SIZE
@ UDS_SIZE
Size of the file.
Definition global.h:319
TDEIO::UDS_MODIFICATION_TIME
@ UDS_MODIFICATION_TIME
The last time the file was modified.
Definition global.h:358
TDEIO::UDSEntry
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition global.h:507
TDEIO::rename
TDEIO_EXPORT SimpleJob * rename(const KURL &src, const KURL &dest, bool overwrite)
Rename a file or directory.
Definition job.cpp:801
TDEIO::filePreview
TDEIO_EXPORT PreviewJob * filePreview(const KFileItemList &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const TQStringList *enabledPlugins=0)
Creates a PreviewJob to generate or retrieve a preview image for the given URL.
Definition previewjob.cpp:574
TDEIO::get
TDEIO_EXPORT TransferJob * get(const KURL &url, bool reload=false, bool showProgressInfo=true)
Get (a.k.a.
Definition job.cpp:1284
TDEIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition global.h:39
TDEIO::stat
TDEIO_EXPORT StatJob * stat(const KURL &url, bool showProgressInfo=true)
Find all details for one file or directory.
Definition job.cpp:950

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.8
This website is maintained by Timothy Pearson.