summaryrefslogtreecommitdiffstats
path: root/tdefile-plugins/flac/tdefile_flac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdefile-plugins/flac/tdefile_flac.cpp')
-rw-r--r--tdefile-plugins/flac/tdefile_flac.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/tdefile-plugins/flac/tdefile_flac.cpp b/tdefile-plugins/flac/tdefile_flac.cpp
index 85d52068..207e3928 100644
--- a/tdefile-plugins/flac/tdefile_flac.cpp
+++ b/tdefile-plugins/flac/tdefile_flac.cpp
@@ -32,17 +32,20 @@
#include <kdebug.h>
#include <kurl.h>
-#include <kprocess.h>
+#include <tdeprocess.h>
#include <tdelocale.h>
#include <kgenericfactory.h>
#include <ksavefile.h>
#include <tag.h>
+#include <taglib.h>
#if (TAGLIB_MAJOR_VERSION>1) || \
((TAGLIB_MAJOR_VERSION==1) && (TAGLIB_MINOR_VERSION>=2))
#define TAGLIB_1_2
#endif
+#define TStringToTQString(s) TQString::fromUtf8((s).toCString(true))
+
#include <tstring.h>
#include <tfile.h>
#include <flacfile.h>
@@ -181,13 +184,13 @@ bool KFlacPlugin::readInfo( KFileMetaInfo& info, uint what )
TQString date = file->tag()->year() > 0 ? TQString::number(file->tag()->year()) : TQString();
TQString track = file->tag()->track() > 0 ? TQString::number(file->tag()->track()) : TQString();
- appendItem(commentgroup, "Title", TQString(TStringToQString(file->tag()->title())).stripWhiteSpace());
- appendItem(commentgroup, "Artist", TQString(TStringToQString(file->tag()->artist())).stripWhiteSpace());
- appendItem(commentgroup, "Album", TQString(TStringToQString(file->tag()->album())).stripWhiteSpace());
+ appendItem(commentgroup, "Title", TStringToTQString(file->tag()->title()).stripWhiteSpace());
+ appendItem(commentgroup, "Artist", TStringToTQString(file->tag()->artist()).stripWhiteSpace());
+ appendItem(commentgroup, "Album", TStringToTQString(file->tag()->album()).stripWhiteSpace());
appendItem(commentgroup, "Date", date);
- appendItem(commentgroup, "Comment", TQString(TStringToQString(file->tag()->comment())).stripWhiteSpace());
+ appendItem(commentgroup, "Comment", TStringToTQString(file->tag()->comment()).stripWhiteSpace());
appendItem(commentgroup, "Tracknumber", track);
- appendItem(commentgroup, "Genre", TQString(TStringToQString(file->tag()->genre())).stripWhiteSpace());
+ appendItem(commentgroup, "Genre", TStringToTQString(file->tag()->genre()).stripWhiteSpace());
}
if (readTech && file->audioProperties())
@@ -198,7 +201,7 @@ bool KFlacPlugin::readInfo( KFileMetaInfo& info, uint what )
appendItem(techgroup, "Bitrate", properties->bitrate());
appendItem(techgroup, "Sample Rate", properties->sampleRate());
- appendItem(techgroup, "Sample Width", properties->sampleWidth());
+ appendItem(techgroup, "Sample Width", properties->bitsPerSample());
appendItem(techgroup, "Channels", properties->channels());
appendItem(techgroup, "Length", properties->length());
}
@@ -232,7 +235,7 @@ bool KFlacPlugin::writeInfo(const KFileMetaInfo& info) const
{
TagLib::File *file;
- if (!TagLib::File::isWritable(TQFile::encodeName(info.path()).data())) {
+ if (access(info.path().local8Bit().data(), R_OK|W_OK)) {
kdDebug(7034) << "can't write to " << info.path() << endl;
return false;
}