"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Helpers.cpp" between
MP3Diags-unstable-1.3.04.tar.gz and MP3Diags-unstable-1.5.01.tar.gz

About: MP3 Diags finds problems in MP3 files and helps the user to fix many of them (with a GUI). Also includes a tag editor and a file renamer.

Helpers.cpp  (MP3Diags-unstable-1.3.04):Helpers.cpp  (MP3Diags-unstable-1.5.01)
skipping to change at line 31 skipping to change at line 31
#include <iostream> #include <iostream>
#include "fstream_unicode.h" #include "fstream_unicode.h"
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <cstdio> #include <cstdio>
#include <boost/version.hpp> #include <boost/version.hpp>
#include <QDesktopServices> #include <QDesktopServices>
#include <QTableView>
#ifndef WIN32 #ifndef WIN32
#include <QDir> #include <QDir>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <unistd.h> #include <unistd.h>
#else #else
#include <windows.h> #include <windows.h>
#include <psapi.h> #include <psapi.h>
#include <QSettings> #include <QSettings>
#endif #endif
skipping to change at line 766 skipping to change at line 767
if (string::npos != strBfr.find("kdeinit")) if (string::npos != strBfr.find("kdeinit"))
{ {
bIsKde = true; bIsKde = true;
} }
//if (string::npos != strBfr.find("kde4/libexec")) // this g ives false positives on openSUSE 11.4 from KDE 3: //if (string::npos != strBfr.find("kde4/libexec")) // this g ives false positives on openSUSE 11.4 from KDE 3:
// for i in `ls /proc | grep '^[0-9]'` ; do a=`cat /proc/$i/ cmdline 2>/dev/null` ; echo $a | grep kde4/libexec ; done // for i in `ls /proc | grep '^[0-9]'` ; do a=`cat /proc/$i/ cmdline 2>/dev/null` ; echo $a | grep kde4/libexec ; done
if (string::npos != strBfr.find("kde4/libexec/start")) // tt t2 probably works only on Suse and only in some cases if (string::npos != strBfr.find("kde4/libexec/start")) // tt t2 probably works only on Suse and only in some cases
{ {
bIsKde4 = true; bIsKde4 = true; //ttt9 update
} }
}//*/ }//*/
} }
} }
//if (string::npos != strBfr.find("kdeinit")) //if (string::npos != strBfr.find("kdeinit"))
fs.findNext(); fs.findNext();
} }
skipping to change at line 857 skipping to change at line 858
#if QT_VERSION >= 0x040500 #if QT_VERSION >= 0x040500
//Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDeskt opDetector(); return dd.onDesktop(DesktopDetector::Kde) ? Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint : (dd.onDesktop(Desktop Detector::Gnome3) ? Qt::Window : Qt::WindowTitleHint); } //Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDeskt opDetector(); return dd.onDesktop(DesktopDetector::Kde) ? Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint : (dd.onDesktop(Desktop Detector::Gnome3) ? Qt::Window : Qt::WindowTitleHint); }
Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDesktop Detector(); return dd.onDesktop(DesktopDetector::Kde) ? Qt::WindowTitleHint | Qt ::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint : (/*dd.onDesktop(Desktop Detector::Gnome3) ? Qt::Window :*/ Qt::WindowTitleHint); } Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDesktop Detector(); return dd.onDesktop(DesktopDetector::Kde) ? Qt::WindowTitleHint | Qt ::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint : (/*dd.onDesktop(Desktop Detector::Gnome3) ? Qt::Window :*/ Qt::WindowTitleHint); }
#else #else
//Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDeskt opDetector(); return dd.onDesktop(DesktopDetector::Gnome3) ? Qt::Window : Qt::Wi ndowTitleHint; } //Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDeskt opDetector(); return dd.onDesktop(DesktopDetector::Gnome3) ? Qt::Window : Qt::Wi ndowTitleHint; }
Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDesktop Detector(); return /*dd.onDesktop(DesktopDetector::Gnome3) ? Qt::Window :*/ Qt:: WindowTitleHint; } Qt::WindowFlags getDialogWndFlags() { const DesktopDetector& dd = getDesktop Detector(); return /*dd.onDesktop(DesktopDetector::Gnome3) ? Qt::Window :*/ Qt:: WindowTitleHint; }
// ttt0 perhaps better to make sure all dialogs have their ok/cancel buttons , so there's no need for a dedicated close button and let the app look more "nat ive" // ttt0 perhaps better to make sure all dialogs have their ok/cancel buttons , so there's no need for a dedicated close button and let the app look more "nat ive"
#endif #endif
Qt::WindowFlags getNoResizeWndFlags() { return Qt::WindowTitleHint; } Qt::WindowFlags getNoResizeWndFlags() { return Qt::WindowTitleHint; }
#else #else
Qt::WindowFlags getMainWndFlags() { return Qt::WindowTitleHint | Qt::WindowM Qt::WindowFlags getMainWndFlags() {
aximizeButtonHint | Qt::WindowMinimizeButtonHint; } // minimize, maximize, no "w return Qt::WindowTitleHint | Qt::WindowMaximizeButtonHint | Qt::W
hat's this" indowMinimizeButtonHint | Qt::WindowCloseButtonHint;
Qt::WindowFlags getDialogWndFlags() { return Qt::WindowTitleHint | Qt::Windo } // minimize, maximize, no "what's this"
wMaximizeButtonHint; } // minimize, no "what's this" Qt::WindowFlags getDialogWndFlags() { return Qt::WindowTitleHint | Qt::Windo
Qt::WindowFlags getNoResizeWndFlags() { return Qt::WindowTitleHint; } // no wMaximizeButtonHint | Qt::WindowCloseButtonHint; } // minimize, no "what's this"
"what's this" Qt::WindowFlags getNoResizeWndFlags() { return Qt::WindowTitleHint; } // no
"what's this" // ttt2 review if we want Qt::WindowCloseButtonHint
#endif #endif
#if 0 #if 0
//ttt2 add desktop, distribution, WM, ... //ttt2 add desktop, distribution, WM, ...
#ifndef WIN32 #ifndef WIN32
utsname info; utsname info;
uname(&info); uname(&info);
cat /proc/version cat /proc/version
cat /etc/issue cat /etc/issue
skipping to change at line 1081 skipping to change at line 1084
vector<QString> getLocalHelpDirs() vector<QString> getLocalHelpDirs()
{ {
static vector<QString> s_v; static vector<QString> s_v;
if (s_v.empty()) if (s_v.empty())
{ {
#ifndef WIN32 #ifndef WIN32
//s_v.push_back("/home/ciobi/cpp/Mp3Utils/mp3diags/trunk/mp3diags/doc/ht ml/"); //s_v.push_back("/home/ciobi/cpp/Mp3Utils/mp3diags/trunk/mp3diags/doc/ht ml/");
s_v.push_back(QString("/usr/share/") + getHelpPackageName() + "-doc/html /"); //ttt0 lower/uppercase variations s_v.push_back(QString("/usr/share/") + getHelpPackageName() + "-doc/html /"); //ttt0 lower/uppercase variations
s_v.push_back(QString("/usr/share/doc/") + getHelpPackageName() + "/html /"); s_v.push_back(QString("/usr/share/doc/") + getHelpPackageName() + "/html /");
s_v.push_back(QString("/usr/share/doc/") + getHelpPackageName() + "-1.3. 04/html/"); s_v.push_back(QString("/usr/share/doc/") + getHelpPackageName() + "-1.5. 01/html/");
#else #else
wchar_t wszModule [200]; wchar_t wszModule [200];
int nRes (GetModuleFileName(0, wszModule, 200)); int nRes (GetModuleFileName(0, wszModule, 200));
//qDebug("%s", QString::fromWCharArray(wszModule).toUtf8().constData()); //qDebug("%s", QString::fromWCharArray(wszModule).toUtf8().constData());
if (0 < nRes && nRes < 200) if (0 < nRes && nRes < 200)
{ {
s_v.push_back(QFileInfo( s_v.push_back(QFileInfo(
fromNativeSeparators(QString::fromWCharArray(wszModule))).di r().absolutePath() + "/doc/"); fromNativeSeparators(QString::fromWCharArray(wszModule))).di r().absolutePath() + "/doc/");
//qDebug("%s", s_v.back().toUtf8().constData()); //qDebug("%s", s_v.back().toUtf8().constData());
} }
skipping to change at line 1727 skipping to change at line 1730
*m_pStoredDuration = getDuration(); *m_pStoredDuration = getDuration();
} }
} }
} }
/*static*/ std::string CB_LIB_CALL Timer::addThSep(int64_t nTime) // to be used when converting to milli- / micro- seconds /*static*/ std::string CB_LIB_CALL Timer::addThSep(int64_t nTime) // to be used when converting to milli- / micro- seconds
{ {
char a [25]; char a [25];
//sprintf(a, "%f", double(nTime)); // //sprintf(a, "%f", double(nTime)); //
//sprintf(a, "%lld", nTime); //sprintf(a, "%lld", nTime);
sprintf(a, "%ld", nTime); sprintf(a, "%ld", nTime);//ttt00 warning in Ubuntu 9.04 due to type mismatch
int n ((int)strlen(a)); int n ((int)strlen(a));
std::string strRes; std::string strRes;
for (int i = 0; i < n; ++i) for (int i = 0; i < n; ++i)
{ {
if (!strRes.empty() && 0 == (n - i)%3) { strRes += ','; } //ttt2 assumes that "a" doesn't have separators already if (!strRes.empty() && 0 == (n - i)%3) { strRes += ','; } //ttt2 assumes that "a" doesn't have separators already
strRes += a[i]; strRes += a[i];
} }
return strRes; return strRes;
} }
skipping to change at line 1752 skipping to change at line 1755
int hrs (min / 60); min %= 60; int hrs (min / 60); min %= 60;
char a[40]; char a[40];
sprintf(a, "%d:%02d:%02d.%03d", hrs, min, sec, msec); sprintf(a, "%d:%02d:%02d.%03d", hrs, min, sec, msec);
return a; return a;
} }
//============================================================================== =============== //============================================================================== ===============
//============================================================================== =============== //============================================================================== ===============
//============================================================================== =============== //============================================================================== ===============
void decreaseRowHeaderFont(QTableView& qtableView)
{
#ifdef WIN32
QFont font(qtableView.verticalHeader()->font());
auto sz(font.pointSizeF());
font.setPointSizeF(sz * 0.85);
qtableView.verticalHeader()->setFont(font);
#endif
}
//ttt2 F1 help was very slow on XP once, not sure why; later it was OK //ttt2 F1 help was very slow on XP once, not sure why; later it was OK
//ttt1 maybe switch to new spec, lower-case for exe name, package, and icons //ttt1 maybe switch to new spec, lower-case for exe name, package, and icons
 End of changes. 6 change blocks. 
10 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)