~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include "FileSystem.h"
34
34
 
35
35
#include "CString.h"
36
 
#include "NotImplemented.h"
37
36
#include "PlatformString.h"
38
37
 
39
38
#include <QDateTime>
65
64
{
66
65
    QFileInfo info(path);
67
66
    result = info.size();
68
 
    return info.exists(); 
 
67
    return info.exists();
69
68
}
70
69
 
71
70
bool getFileModificationTime(const String& path, time_t& result)
82
81
 
83
82
String pathByAppendingComponent(const String& path, const String& component)
84
83
{
85
 
    return QDir(path).filePath(component);
 
84
    return QDir::toNativeSeparators(QDir(path).filePath(component));
86
85
}
87
86
 
88
87
String homeDirectoryPath()
97
96
 
98
97
String directoryName(const String& path)
99
98
{
100
 
    return String(QFileInfo(path).baseName());
 
99
    return String(QFileInfo(path).absolutePath());
101
100
}
102
101
 
103
102
Vector<String> listDirectory(const String& path, const String& filter)
118
117
 
119
118
CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
120
119
{
121
 
    QFile *temp = new QTemporaryFile(QLatin1String(prefix));
 
120
    QTemporaryFile* tempFile = new QTemporaryFile(QLatin1String(prefix));
 
121
    tempFile->setAutoRemove(false);
 
122
    QFile* temp = tempFile;
122
123
    if (temp->open(QIODevice::ReadWrite)) {
123
124
        handle = temp;
124
125
        return String(temp->fileName()).utf8();
125
126
    }
126
127
    handle = invalidPlatformFileHandle;
127
 
    return 0;
 
128
    return CString();
128
129
}
129
130
 
130
131
void closeFile(PlatformFileHandle& handle)
143
144
    return 0;
144
145
}
145
146
 
146
 
#if defined(Q_WS_X11) || defined(Q_WS_QWS)
147
147
bool unloadModule(PlatformModule module)
148
148
{
 
149
#if defined(Q_WS_MAC)
 
150
    CFRelease(module);
 
151
    return true;
 
152
 
 
153
#elif defined(Q_OS_WIN)
 
154
    return ::FreeLibrary(module);
 
155
 
 
156
#else
149
157
    if (module->unload()) {
150
158
        delete module;
151
159
        return true;
152
160
    }
153
161
 
154
162
    return false;
155
 
}
156
 
#endif
157
 
 
158
 
#if defined(Q_WS_MAC)
159
 
bool unloadModule(PlatformModule module)
160
 
{
161
 
    CFRelease(module);
162
 
    return true;
163
 
}
164
 
#endif
165
 
 
166
 
#if defined(Q_OS_WIN)
167
 
bool unloadModule(PlatformModule module)
168
 
{
169
 
    return ::FreeLibrary(module);
170
 
}
171
 
#endif
 
163
#endif
 
164
}
172
165
 
173
166
}
174
167