summaryrefslogtreecommitdiffstats
path: root/kfile-plugins/rgb
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-19 19:03:33 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-19 19:03:33 +0000
commite69e8b1d09fb579316595b4e6a850e717358a8b1 (patch)
treea24fc20865f65772f530d16177520190594ffdd2 /kfile-plugins/rgb
parenteecec9afb81fdebb0f22e9da22635874c403f854 (diff)
downloadtdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.tar.gz
tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.zip
TQt4 port kdegraphics
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfile-plugins/rgb')
-rw-r--r--kfile-plugins/rgb/kfile_rgb.cpp56
-rw-r--r--kfile-plugins/rgb/kfile_rgb.h5
2 files changed, 31 insertions, 30 deletions
diff --git a/kfile-plugins/rgb/kfile_rgb.cpp b/kfile-plugins/rgb/kfile_rgb.cpp
index cf832343..3c8b416e 100644
--- a/kfile-plugins/rgb/kfile_rgb.cpp
+++ b/kfile-plugins/rgb/kfile_rgb.cpp
@@ -32,8 +32,8 @@ typedef KGenericFactory<KRgbPlugin> RgbFactory;
K_EXPORT_COMPONENT_FACTORY(kfile_rgb, RgbFactory("kfile_rgb"))
-KRgbPlugin::KRgbPlugin(TQObject *parent, const char *name, const TQStringList &args) :
- KFilePlugin(parent, name, args)
+KRgbPlugin::KRgbPlugin(TQObject *tqparent, const char *name, const TQStringList &args) :
+ KFilePlugin(tqparent, name, args)
{
KFileMimeTypeInfo* info = addMimeTypeInfo("image/x-rgb");
@@ -71,24 +71,24 @@ bool KRgbPlugin::readInfo(KFileMetaInfo& info, uint /*what*/)
TQFile file(info.path());
if (!file.open(IO_ReadOnly)) {
- kdDebug(7034) << "Couldn't open " << TQFile::encodeName(info.path()) << endl;
+ kdDebug(7034) << "Couldn't open " << TQFile::encodeName(info.path()).data() << endl;
return false;
}
TQDataStream dstream(&file);
- Q_UINT16 magic;
- Q_UINT8 storage;
- Q_UINT8 bpc;
- Q_UINT16 dimension;
- Q_UINT16 xsize;
- Q_UINT16 ysize;
- Q_UINT16 zsize;
- Q_UINT32 pixmin;
- Q_UINT32 pixmax;
- Q_UINT32 dummy;
+ TQ_UINT16 magic;
+ TQ_UINT8 storage;
+ TQ_UINT8 bpc;
+ TQ_UINT16 dimension;
+ TQ_UINT16 xsize;
+ TQ_UINT16 ysize;
+ TQ_UINT16 zsize;
+ TQ_UINT32 pixmin;
+ TQ_UINT32 pixmax;
+ TQ_UINT32 dummy;
char imagename[80];
- Q_UINT32 colormap;
+ TQ_UINT32 colormap;
dstream >> magic;
dstream >> storage;
@@ -103,7 +103,7 @@ bool KRgbPlugin::readInfo(KFileMetaInfo& info, uint /*what*/)
dstream.readRawBytes(imagename, 80);
imagename[79] = '\0';
dstream >> colormap;
- Q_UINT8 u8;
+ TQ_UINT8 u8;
for (uint i = 0; i < 404; i++)
dstream >> u8;
@@ -134,17 +134,17 @@ bool KRgbPlugin::readInfo(KFileMetaInfo& info, uint /*what*/)
long compressed = file.size() - 512;
long verbatim = xsize * ysize * zsize;
appendItem(group, "Compression", i18n("Runlength Encoded")
- + TQString(", %1%").arg(compressed * 100.0 / verbatim, 0, 'f', 1));
+ + TQString(", %1%").tqarg(compressed * 100.0 / verbatim, 0, 'f', 1));
long k;
- Q_UINT32 offs;
- TQMap<Q_UINT32, uint> map;
- TQMap<Q_UINT32, uint>::Iterator it;
- TQMap<Q_UINT32, uint>::Iterator end = map.end();
+ TQ_UINT32 offs;
+ TQMap<TQ_UINT32, uint> map;
+ TQMap<TQ_UINT32, uint>::Iterator it;
+ TQMap<TQ_UINT32, uint>::Iterator end = map.end();
for (k = 0; k < (ysize * zsize); k++) {
dstream >> offs;
- if ((it = map.find(offs)) != end)
- map.replace(offs, it.data() + 1);
+ if ((it = map.tqfind(offs)) != end)
+ map.tqreplace(offs, it.data() + 1);
else
map[offs] = 0;
}
@@ -152,7 +152,7 @@ bool KRgbPlugin::readInfo(KFileMetaInfo& info, uint /*what*/)
k += it.data();
if (k)
- appendItem(group, "SharedRows", TQString("%1%").arg(k * 100.0
+ appendItem(group, "SharedRows", TQString("%1%").tqarg(k * 100.0
/ (ysize * zsize), 0, 'f', 1));
else
appendItem(group, "SharedRows", i18n("None"));
@@ -173,7 +173,7 @@ bool KRgbPlugin::writeInfo(const KFileMetaInfo& info) const
TQFile file(info.path());
if (!file.open(IO_WriteOnly|IO_Raw)) {
- kdDebug(7034) << "couldn't open " << TQFile::encodeName(info.path()) << endl;
+ kdDebug(7034) << "couldn't open " << TQFile::encodeName(info.path()).data() << endl;
return false;
}
@@ -188,9 +188,9 @@ bool KRgbPlugin::writeInfo(const KFileMetaInfo& info) const
unsigned i;
for (i = 0; i < s.length(); i++)
- dstream << Q_UINT8(s.latin1()[i]);
+ dstream << TQ_UINT8(s.latin1()[i]);
for (; i < 80; i++)
- dstream << Q_UINT8(0);
+ dstream << TQ_UINT8(0);
file.close();
return true;
@@ -199,9 +199,9 @@ bool KRgbPlugin::writeInfo(const KFileMetaInfo& info) const
// restrict to 79 ASCII characters
TQValidator* KRgbPlugin::createValidator(const TQString&, const TQString &,
- const TQString &, TQObject* parent, const char* name) const
+ const TQString &, TQObject* tqparent, const char* name) const
{
- return new TQRegExpValidator(TQRegExp("[\x0020-\x007E]{79}"), parent, name);
+ return new TQRegExpValidator(TQRegExp("[\x0020-\x007E]{79}"), tqparent, name);
}
diff --git a/kfile-plugins/rgb/kfile_rgb.h b/kfile-plugins/rgb/kfile_rgb.h
index c00ddfb5..bbbfd1b4 100644
--- a/kfile-plugins/rgb/kfile_rgb.h
+++ b/kfile-plugins/rgb/kfile_rgb.h
@@ -27,14 +27,15 @@ class TQStringList;
class KRgbPlugin : public KFilePlugin
{
Q_OBJECT
+ TQ_OBJECT
public:
- KRgbPlugin(TQObject *parent, const char *name, const TQStringList& args);
+ KRgbPlugin(TQObject *tqparent, const char *name, const TQStringList& args);
virtual bool readInfo(KFileMetaInfo& info, uint what);
virtual bool writeInfo(const KFileMetaInfo& info) const;
virtual TQValidator* createValidator(const TQString& mimetype,
const TQString &group, const TQString &key,
- TQObject* parent, const char* name) const;
+ TQObject* tqparent, const char* name) const;
};