Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Some debug prints removed. Timeout for Systray to load increased to 1…
Browse files Browse the repository at this point in the history
… minute. Module crash detection improved.
  • Loading branch information
kuzmas committed Dec 1, 2012
1 parent b0b6a30 commit e3e3dab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions razorqt-runner/providers.cpp
Expand Up @@ -118,11 +118,11 @@ CommandProvider::CommandProvider():
************************************************/
CommandProvider::~CommandProvider()
{
qDebug() << "*****************************************";
qDebug() << hex << this;
qDebug() << "DESTROY";
// qDebug() << "*****************************************";
// qDebug() << hex << this;
// qDebug() << "DESTROY";
qDeleteAll(*this);
qDebug() << "*****************************************";
// qDebug() << "*****************************************";
}


Expand All @@ -148,12 +148,12 @@ AppLinkItem::AppLinkItem(const QDomElement &element):
************************************************/
void AppLinkItem::updateIcon()
{
qDebug() << "*****************************************";
qDebug() << hex << this;
qDebug() << Q_FUNC_INFO;
// qDebug() << "*****************************************";
// qDebug() << hex << this;
// qDebug() << Q_FUNC_INFO;
if (mIcon.isNull())
mIcon = XdgIcon::fromTheme(mIconName);
qDebug() << "*****************************************";
// qDebug() << "*****************************************";
}


Expand Down
21 changes: 9 additions & 12 deletions razorqt-session/razor-session/src/razormodman.cpp
Expand Up @@ -98,7 +98,7 @@ void RazorModuleManager::startup()
int waitCnt = 300;
while (!xfitMan().isWindowManagerActive() && waitCnt)
{
qDebug() << "******************** Wait until the WM loads" << waitCnt;
// qDebug() << "******************** Wait until the WM loads" << waitCnt;
waitCnt--;
usleep(100000);
}
Expand All @@ -117,10 +117,10 @@ void RazorModuleManager::startup()

if (!trayApps.isEmpty())
{
int waitCnt = 200;
int waitCnt = 600;
while (!QSystemTrayIcon::isSystemTrayAvailable())
{
qDebug() << "******************** Wait for tray" << waitCnt;
// qDebug() << "******************** Wait for tray" << waitCnt;
if (!waitCnt)
{
qWarning() << "******************** No systray implementation started in session. Continuing.";
Expand All @@ -133,9 +133,6 @@ void RazorModuleManager::startup()
foreach (XdgDesktopFile* f, trayApps)
startProcess(*f);
}

m_crashTimer.setInterval(60000);
connect(&m_crashTimer, SIGNAL(timeout()), this, SLOT(resetCrashReport()));
}

void RazorModuleManager::startProcess(const XdgDesktopFile& file)
Expand Down Expand Up @@ -212,14 +209,14 @@ void RazorModuleManager::restartModules(int exitCode, QProcess::ExitStatus exitS
case QProcess::CrashExit:
{
qDebug() << "Process" << procName << "(" << proc << ") has to be restarted";
if (!m_crashReport.contains(proc))
m_crashReport[proc] = 0;
int stat = m_crashReport[proc]++;
if (stat >= MAX_CRASHES_PER_APP)
time_t now = time(NULL);
mCrashReport[proc].prepend(now);
while (now - mCrashReport[proc].back() > 60)
mCrashReport[proc].pop_back();
if (mCrashReport[proc].length() >= MAX_CRASHES_PER_APP)
{
QMessageBox::warning(0, tr("Razor Session Crash Report"),
tr("Application '%1' crashed too many times. Its autorestart has been disabled for current session.").arg(procName));

}
else
{
Expand Down Expand Up @@ -290,7 +287,7 @@ QString RazorModuleManager::showWmSelectDialog()

void RazorModuleManager::resetCrashReport()
{
m_crashReport.clear();
mCrashReport.clear();
}

void razor_setenv(const char *env, const QByteArray &value)
Expand Down
9 changes: 6 additions & 3 deletions razorqt-session/razor-session/src/razormodman.h
Expand Up @@ -29,15 +29,19 @@
#define RAZORMODMAN_H

#include <QtCore/QProcess>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QTimer>
#include <qtxdg/xdgdesktopfile.h>

#include <time.h>

class RazorModule;

typedef QMap<QString,RazorModule*> ModulesMap;
typedef QMapIterator<QString,RazorModule*> ModulesMapIterator;
typedef QMap<QProcess*,int> ModulesCrashReport;
typedef QList<time_t> ModuleCrashReport;
typedef QMap<QProcess*, ModuleCrashReport> ModulesCrashReport;

/*! \brief RazorModuleManager manages the processes of the session
and which modules of razor are about to load.
Expand Down Expand Up @@ -112,8 +116,7 @@ public slots:
/*! \brief Keep creashes for given process to raise a message in the
case of repeating crashes
*/
ModulesCrashReport m_crashReport;
QTimer m_crashTimer;
ModulesCrashReport mCrashReport;

private slots:

Expand Down

0 comments on commit e3e3dab

Please sign in to comment.