~ubuntu-branches/ubuntu/vivid/kdesdk/vivid

« back to all changes in this revision

Viewing changes to kmtrace/match.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-14 15:11:09 UTC
  • mfrom: (0.4.22)
  • Revision ID: package-import@ubuntu.com-20120614151109-t9h5vc8qga2sz5yo
Tags: 4:4.8.90-0ubuntu1
New upstream beta release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <q3intdict.h>
 
1
// Qt
 
2
#include <QStringList>
 
3
#include <QHash>
 
4
// C++
2
5
#include <stdio.h>
3
 
#include <qstringlist.h>
4
 
#include <q3strlist.h>
5
 
#include <qtextstream.h>
6
 
#include <q3sortedlist.h>
7
 
#include <qfile.h>
8
 
#include <q3tl.h>
9
 
#include <q3dict.h>
10
 
#include <q3valuelist.h>
11
6
#include <stdlib.h>
12
 
#include <ktemporaryfile.h>
13
 
#include <kcomponentdata.h>
14
 
#include <kstandarddirs.h>
15
 
#include <kcmdlineargs.h>
 
7
 
16
8
 
17
9
int main(int argc, char **argv)
18
10
{
29
21
   }
30
22
 
31
23
   int i = 1;
32
 
   Q3Dict<int> dict(20011);
 
24
   QHash<QString,int> dict;
 
25
   dict.reserve(20011);
33
26
 
34
27
   FILE *map_file = fopen(argv[1], "r");
35
28
   if (!map_file)
41
34
   {
42
35
      fgets(buf, 1024, map_file);
43
36
      QString line = QString::fromLatin1(buf).trimmed();
44
 
      const QStringList split = line.split(' ', QString::SkipEmptyParts);
 
37
      const QStringList split = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
45
38
      if (split.count() <= 1)
46
39
         return 1;
47
40
 
48
 
      if (split[1] == "T")
 
41
      if (split.at(1) == QLatin1String("T"))
49
42
      {
50
 
         dict.insert(split[2], &i);
 
43
         dict.insert(split.value(2), i);
51
44
      }
52
45
   }
53
46
   fclose(map_file);
63
56
   {
64
57
      fgets(buf, 1024, call_file);
65
58
      QString line = QString::fromLatin1(buf).trimmed();
66
 
      if (dict.find(line))
 
59
      if (dict.contains(line))
67
60
      {
68
61
         qWarning("%s", qPrintable(line));
69
62
      }