Logo Search packages:      
Sourcecode: kallery version File versions  Download package

void Kallery::initFilters (  )  [private]

Initialize ImageMagick and load the supported filter list.

Definition at line 186 of file kallery.cpp.

References KalleryGlobals::ref(), and KalleryGlobals::setImageFilter().

Referenced by Kallery().

{
  InitializeMagick(QDir::currentDirPath());

  const MagickInfo **mInfoList;
  unsigned long numberOfItems;

#ifdef IMAGEMAGICK_6_0
  mInfoList = GetMagickInfoList("*", &numberOfItems);
#else
  ExceptionInfo exception;
  GetExceptionInfo(&exception);
  mInfoList = GetMagickInfoList("*", &numberOfItems, &exception);
#endif

  QString tmpStr;
  QString allFilter;
  QString imageFilter;
  for (uint i = 0; i < numberOfItems; i++)
  {
    const MagickInfo *mInfo = mInfoList[i];
    tmpStr = mInfo->name;
    if (!tmpStr.isEmpty())
    {
      allFilter += "*."+  tmpStr.lower()+" ";
      imageFilter +=  "*." + tmpStr.lower() +"|"+ QString(mInfo->description)+
                                  " file (*."+ tmpStr.lower() +")\n";
    }
  };
  imageFilter = allFilter +"|All ImageMagick suported image files\n*|All files\n" + imageFilter;

  imageFilter.replace(QRegExp("/"),"");
  KalleryGlobals::ref()->setImageFilter(imageFilter);
  kdDebug() << "ImageMagick initalized, filters read." << endl;
}


Generated by  Doxygen 1.6.0   Back to index