Changeset 945 for trunk/src/corelib/io


Ignore:
Timestamp:
Aug 5, 2011, 11:26:12 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: Make native QFileSystemWatcher recognize file changes.

The original notification mechanism does not actually implement
the file date/time/size change notification. To solve this,
we add another thread that only check for file attribute changes
at specified polling intervals (using a relatively fast native stat call)
and nothing more.

The file change notification is needed e.g. for Qt Creator which
uses it to detect external file notifications in the editor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/io/qfilesystemwatcher_os2.cpp

    r944 r945  
    9494QT_BEGIN_NAMESPACE
    9595
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
    96128class QOS2FileSysWatcherThread : public QThread
    97129{
     
    113145    static void removePaths(QOS2FileSystemWatcherEngine *engine);
    114146
     147
     148
    115149    static bool isOk() { return instance->notifyPipe != NULLHANDLE; }
    116150
     
    121155
    122156    void run();
     157
     158
    123159
    124160    int refcnt;
     
    127163    HFILE notifyPipe;
    128164    HEV eventSem;
     165
     166
    129167
    130168    enum Type { None = 0, Dir, File };
     
    143181};
    144182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252