traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/traverso/widgets InfoWidgets.cpp


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/traverso/widgets InfoWidgets.cpp
Date: Tue, 24 Apr 2007 11:16:28 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/04/24 11:16:28

Modified files:
        src/traverso/widgets: InfoWidgets.cpp 

Log message:
        * Use GetDiskFreeSpaceEx on windows to get free diskspace (fails with 
error 3 here, weird ?) 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/InfoWidgets.cpp?cvsroot=traverso&r1=1.17&r2=1.18

Patches:
Index: InfoWidgets.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/widgets/InfoWidgets.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- InfoWidgets.cpp     23 Apr 2007 11:56:52 -0000      1.17
+++ InfoWidgets.cpp     24 Apr 2007 11:16:28 -0000      1.18
@@ -35,7 +35,11 @@
 #include <QDesktopWidget>
 #include <QPalette>
 
+#if defined (WIN_BUILD)
+#include <Windows.h>
+#else
 #include <sys/vfs.h>
+#endif
 
 
 // Always put me below _all_ includes, this is needed
@@ -274,9 +278,24 @@
                return;
        }
        
+#if defined (WIN_BUILD)
+       __int64 freebytestocaller, totalbytes, freebytes; 
+       if (! GetDiskFreeSpaceEx ((const 
WCHAR*)(QS_C(m_project->get_root_dir())),
+                                       (PULARGE_INTEGER)&freebytestocaller,
+                                       (PULARGE_INTEGER)&totalbytes,
+                                       (PULARGE_INTEGER)&freebytes)) 
+       {
+               info().warning("HHDSpaceInfo: " + QString().sprintf("error: 
%lu", GetLastError()));
+               m_button->setText("No Info");
+               return;
+       }
+       
+       double space =  double(freebytestocaller / (1 << 20));
+#else
        struct statfs fs;
        statfs(QS_C(m_project->get_root_dir()), &fs);
        double space = floor (fs.f_bavail * (fs.f_bsize / 1048576.0));
+#endif
 
        QList<Song*> recordingSongs;
        foreach(Song* song, m_project->get_songs()) {
@@ -436,6 +455,8 @@
        
        connect(m_song, SIGNAL(transferStopped()), this, 
SLOT(stop_smpte_update_timer()));
        connect(m_song, SIGNAL(transferStarted()), this, 
SLOT(start_smpte_update_timer()));
+       connect(m_song, SIGNAL(transportPosSet()), this, SLOT(update()));
+       
        
        if (m_song->is_transporting()) {
                m_playpixmap = find_pixmap(":/playstop");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]