/[svn]/qsampler/trunk/src/qsamplerMainForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3508 by capela, Mon Apr 1 22:36:26 2019 UTC revision 3520 by capela, Mon Jul 1 10:53:41 2019 UTC
# Line 58  Line 58 
58  #include <QTimer>  #include <QTimer>
59  #include <QDateTime>  #include <QDateTime>
60    
61  #if QT_VERSION >= 0x050000  #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
62  #include <QMimeData>  #include <QMimeData>
63  #endif  #endif
64    
65  #if QT_VERSION < 0x040500  #if QT_VERSION < QT_VERSION_CHECK(4, 5, 0)
66  namespace Qt {  namespace Qt {
67  const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000);  const WindowFlags WindowCloseButtonHint = WindowFlags(0x08000000);
68  }  }
69  #endif  #endif
70    
 #ifdef HAVE_SIGNAL_H  
 #include <signal.h>  
 #endif  
   
71  #ifdef CONFIG_LIBGIG  #ifdef CONFIG_LIBGIG
72  #include <gig.h>  #include <gig.h>
73  #endif  #endif
# Line 93  static inline long lroundf ( float x ) Line 89  static inline long lroundf ( float x )
89  // All winsock apps needs this.  // All winsock apps needs this.
90  #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)  #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
91  static WSADATA _wsaData;  static WSADATA _wsaData;
92    #undef HAVE_SIGNAL_H
93  #endif  #endif
94    
95    
# Line 103  static WSADATA _wsaData; Line 100  static WSADATA _wsaData;
100    
101  #include <QSocketNotifier>  #include <QSocketNotifier>
102    
103    #include <unistd.h>
104  #include <sys/types.h>  #include <sys/types.h>
105  #include <sys/socket.h>  #include <sys/socket.h>
   
106  #include <signal.h>  #include <signal.h>
107    
108  // File descriptor for SIGUSR1 notifier.  // File descriptor for SIGUSR1 notifier.
109  static int g_fdSigusr1[2];  static int g_fdSigusr1[2] = { -1, -1 };
110    
111  // Unix SIGUSR1 signal handler.  // Unix SIGUSR1 signal handler.
112  static void qsampler_sigusr1_handler ( int /* signo */ )  static void qsampler_sigusr1_handler ( int /* signo */ )
# Line 120  static void qsampler_sigusr1_handler ( i Line 117  static void qsampler_sigusr1_handler ( i
117  }  }
118    
119  // File descriptor for SIGTERM notifier.  // File descriptor for SIGTERM notifier.
120  static int g_fdSigterm[2];  static int g_fdSigterm[2] = { -1, -1 };
121    
122  // Unix SIGTERM signal handler.  // Unix SIGTERM signal handler.
123  static void qsampler_sigterm_handler ( int /* signo */ )  static void qsampler_sigterm_handler ( int /* signo */ )
# Line 253  MainForm::MainForm ( QWidget *pParent ) Line 250  MainForm::MainForm ( QWidget *pParent )
250                  SLOT(handle_sigusr1()));                  SLOT(handle_sigusr1()));
251    
252          // Install SIGUSR1 signal handler.          // Install SIGUSR1 signal handler.
253      struct sigaction sigusr1;          struct sigaction sigusr1;
254      sigusr1.sa_handler = qsampler_sigusr1_handler;          sigusr1.sa_handler = qsampler_sigusr1_handler;
255      sigemptyset(&sigusr1.sa_mask);          sigemptyset(&sigusr1.sa_mask);
256      sigusr1.sa_flags = 0;          sigusr1.sa_flags = 0;
257      sigusr1.sa_flags |= SA_RESTART;          sigusr1.sa_flags |= SA_RESTART;
258      ::sigaction(SIGUSR1, &sigusr1, NULL);          ::sigaction(SIGUSR1, &sigusr1, NULL);
259    
260          // Initialize file descriptors for SIGTERM socket notifier.          // Initialize file descriptors for SIGTERM socket notifier.
261          ::socketpair(AF_UNIX, SOCK_STREAM, 0, g_fdSigterm);          ::socketpair(AF_UNIX, SOCK_STREAM, 0, g_fdSigterm);
# Line 855  bool MainForm::newSession (void) Line 852  bool MainForm::newSession (void)
852          m_iUntitled++;          m_iUntitled++;
853    
854          // Stabilize form.          // Stabilize form.
855          m_sFilename = QString::null;          m_sFilename = QString();
856          m_iDirtyCount = 0;          m_iDirtyCount = 0;
857          appendMessages(tr("New session: \"%1\".").arg(sessionName(m_sFilename)));          appendMessages(tr("New session: \"%1\".").arg(sessionName(m_sFilename)));
858          stabilizeForm();          stabilizeForm();
# Line 3112  bool MainForm::startClient (void) Line 3109  bool MainForm::startClient (void)
3109          if (!m_pOptions->sSessionFile.isEmpty()) {          if (!m_pOptions->sSessionFile.isEmpty()) {
3110                  // Just load the prabably startup session...                  // Just load the prabably startup session...
3111                  if (loadSessionFile(m_pOptions->sSessionFile)) {                  if (loadSessionFile(m_pOptions->sSessionFile)) {
3112                          m_pOptions->sSessionFile = QString::null;                          m_pOptions->sSessionFile = QString();
3113                          return true;                          return true;
3114                  }                  }
3115          }          }

Legend:
Removed from v.3508  
changed lines
  Added in v.3520

  ViewVC Help
Powered by ViewVC