~ubuntu-branches/ubuntu/oneiric/valkyrie/oneiric

« back to all changes in this revision

Viewing changes to valkyrie/core/tool_object.cpp

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-09-02 22:08:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110902220834-kigsixteppj9epp5
Tags: 2.0.0-0ubuntu1
* New upstream release. (LP: #635129, LP: #832886, LP: #721298)
* Standards bumped to 3.9.2, no changes required.
* d/control, d/rules: cdbs removed, dh minimal rule instead.
* d/control: build system is qmake not autotools
* d/control: bump required qt to qt4
* d/valkyrie.install: installing html docs manually as make install
  no longer does so.
* d/patches/valkyrie-2.0.0-fix-doc.dir.patch: Fix doc path to match
  policy. Also corrects LP: #588074 since the documentation link now
  works.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ---------------------------------------------------------------------
2
 
 * Definition of class ToolObject                        tool_object.cpp
3
 
 *
4
 
 * Essential functionality is contained within a ToolObject.
5
 
 * Each ToolObject has an associated ToolView for displaying output.
6
 
 * 
7
 
 * See vk_objects.cpp for information on how to add a new valgrind tool.
8
 
 * ---------------------------------------------------------------------
9
 
 * This file is part of Valkyrie, a front-end for Valgrind
10
 
 * Copyright (C) 2000-2008, OpenWorks LLP <info@open-works.co.uk>
11
 
 * This program is released under the terms of the GNU GPL v.2
12
 
 * See the file COPYING for the full license details.
13
 
 */
14
 
 
15
 
#include "tool_object.h"
16
 
#include "tool_view.h"
17
 
#include "vk_config.h"         // vkConfig
18
 
#include "vk_utils.h"          // vk_assert, VK_DEBUG, etc.
19
 
 
20
 
#include <qtimer.h>
21
 
 
22
 
 
23
 
 
24
 
/* class ToolObject ---------------------------------------------------- */
25
 
ToolObject::~ToolObject() 
26
 
{}
27
 
 
28
 
ToolObject::ToolObject( const QString& capt, const QString& txt,
29
 
                        const QKeySequence& key, int objId )
30
 
   : VkObject( capt, txt, key, objId )
31
 
{
32
 
   m_view      = 0;
33
 
   m_fileSaved = true;
34
 
   m_runState  = VkRunState::STOPPED;
35
 
}
36
 
 
37
 
bool ToolObject::isRunning() 
38
 
{
39
 
   return (m_runState != VkRunState::STOPPED);
40
 
}
41
 
 
42
 
 
43
 
void ToolObject::setRunState( VkRunState::State rs )
44
 
{
45
 
   m_runState = rs;
46
 
   emit running( isRunning() );
47
 
}
48
 
 
49
 
 
50
 
void ToolObject::deleteView()
51
 
{
52
 
   emit message( "" );  /* clear the status bar */
53
 
   vk_assert( m_view != 0 );
54
 
 
55
 
   m_view->close( true/*alsoDelete*/ );
56
 
   m_view = 0;
57
 
}
58
 
 
59
 
ToolView* ToolObject::view()
60
 
{
61
 
   return m_view;
62
 
}
63
 
 
64
 
 
65
 
/* called from Valkyrie::updateVgFlags() whenever flags have been changed */
66
 
QStringList ToolObject::modifiedVgFlags()
67
 
{
68
 
   QStringList modFlags;
69
 
 
70
 
   for ( Option* opt = m_optList.first(); opt; opt = m_optList.next() ) {
71
 
 
72
 
      QString defVal = opt->m_defaultValue;     /* opt holds the default */
73
 
      QString cfgVal = vkConfig->rdEntry( opt->m_longFlag, name() );
74
 
 
75
 
      if ( defVal != cfgVal )
76
 
         modFlags << "--" + opt->m_longFlag + "=" + cfgVal;
77
 
   }
78
 
   return modFlags;
79
 
}