Changeset 17567 in webkit
- Timestamp:
- Nov 3, 2006 2:48:15 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/CMakeLists.txt
r17552 r17567 1208 1208 kjs-unity 1209 1209 pcre-unity 1210 z 1210 1211 ) 1211 1212 ELSE (WEBKIT_USE_KDE_SUPPORT) … … 1219 1220 kjs-unity 1220 1221 pcre-unity 1222 z 1221 1223 ) 1222 1224 ENDIF (WEBKIT_USE_KDE_SUPPORT) -
trunk/WebCore/ChangeLog
r17565 r17567 1 2006-11-03 Zack Rusin <zack@kde.org> 2 3 Reviewed by Maciej. 4 5 Compile on both KDE and Qt platforms 6 7 * CMakeLists.txt: add zlib explicitly 8 * platform/network/qt/ResourceHandleManager.cpp: 9 (WebCore::ResourceHandleManager::self): 10 (WebCore::QtJob::QtJob): 11 (WebCore::QtJob::timerEvent): Integrate both implementations 12 so that moc can parse it 13 (WebCore::ResourceHandleManager::deliverJobData): 14 (WebCore::ResourceHandleManager::remove): 15 * platform/network/qt/ResourceHandleManager.h: 16 1 17 2006-11-03 Maciej Stachowiak <mjs@apple.com> 2 18 -
trunk/WebCore/platform/network/qt/ResourceHandleManager.cpp
r17552 r17567 23 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 26 */ 27 27 … … 43 43 static ResourceHandleManager* s_self = 0; 44 44 45 46 ResourceHandleManager* ResourceHandleManager::self() 47 { 48 if (!s_self) 49 s_self = new ResourceHandleManager(); 50 51 return s_self; 52 } 53 54 QtJob::QtJob(const QString& path) 55 : m_path(path) 56 { 57 startTimer(0); 58 } 59 60 void QtJob::timerEvent(QTimerEvent* e) 61 { 62 killTimer(e->timerId()); 63 64 QFile f(m_path); 65 QByteArray data; 66 if (f.open(QIODevice::ReadOnly)) { 67 data = f.readAll(); 68 f.close(); 69 }; 70 71 emit finished(this, data); 72 73 deleteLater(); 74 } 45 75 #if PLATFORM(KDE) 46 76 … … 56 86 } 57 87 58 ResourceHandleManager* ResourceHandleManager::self() 59 { 60 if (!s_self) 61 s_self = new ResourceHandleManager(); 62 63 return s_self; 64 } 65 88 89 void ResourceHandleManager::deliverJobData(QtJob*, const QByteArray&) 90 { 91 92 } 66 93 void ResourceHandleManager::slotData(KIO::Job* kioJob, const QByteArray& data) 67 94 { … … 149 176 // otherwhise assembleResponseHeaders() is called too early... 150 177 RefPtr<PlatformResponseQt> response(new PlatformResponseQt()); 151 response->data = headers; 178 response->data = headers; 152 179 response->url = job->url().url(); 153 180 … … 200 227 } 201 228 229 // Qt Resource Handle Manager 202 230 #else 203 // Qt Resource Handle Manager204 205 QtJob::QtJob(const QString& path)206 : m_path(path)207 {208 startTimer(0);209 }210 211 void QtJob::timerEvent(QTimerEvent* e)212 {213 killTimer(e->timerId());214 215 QFile f(m_path);216 QByteArray data;217 if (f.open(QIODevice::ReadOnly)) {218 data = f.readAll();219 f.close();220 };221 222 emit finished(this, data);223 224 deleteLater();225 }226 227 231 ResourceHandleManager::ResourceHandleManager() 228 232 : m_frameClient(0) … … 234 238 } 235 239 236 ResourceHandleManager* ResourceHandleManager::self()237 {238 if (!s_self)239 s_self = new ResourceHandleManager();240 241 return s_self;242 }243 240 244 241 void ResourceHandleManager::remove(ResourceHandle* job) -
trunk/WebCore/platform/network/qt/ResourceHandleManager.h
r17552 r17567 38 38 class FrameQtClient; 39 39 40 #if PLATFORM(KDE)41 class ResourceHandleManager : public QObject {42 Q_OBJECT43 public:44 static ResourceHandleManager* self();45 46 void add(ResourceHandle*, FrameQtClient*);47 void cancel(ResourceHandle*);48 49 public Q_SLOTS:50 void slotData(KIO::Job*, const QByteArray& data);51 void slotMimetype(KIO::Job*, const QString& type);52 void slotResult(KJob*);53 40 54 private:55 ResourceHandleManager();56 ~ResourceHandleManager();57 58 void remove(ResourceHandle*);59 60 // KIO Job <-> WebKit Job mapping61 QMap<ResourceHandle*, KIO::Job*> m_jobToKioMap;62 QMap<KIO::Job*, ResourceHandle*> m_kioToJobMap;63 64 FrameQtClient* m_frameClient;65 };66 #else67 68 41 class QtJob : public QObject 69 42 { … … 82 55 }; 83 56 84 class ResourceHandleManager : public QObject { 85 Q_OBJECT 57 class ResourceHandleManager : public QObject 58 { 59 Q_OBJECT 86 60 public: 87 61 static ResourceHandleManager* self(); … … 91 65 92 66 public Q_SLOTS: 93 void deliverJobData(QtJob* job, const QByteArray& data); 94 67 void slotData(KIO::Job*, const QByteArray& data); 68 void slotMimetype(KIO::Job*, const QString& type); 69 void slotResult(KJob*); 70 void deliverJobData(QtJob* , const QByteArray&); 71 95 72 private: 96 73 ResourceHandleManager(); … … 99 76 void remove(ResourceHandle*); 100 77 78 #if PLATFORM(KDE) 79 // KIO Job <-> WebKit Job mapping 80 QMap<ResourceHandle*, KIO::Job*> m_jobToKioMap; 81 QMap<KIO::Job*, ResourceHandle*> m_kioToJobMap; 82 #else 83 101 84 QMap<ResourceHandle*, QtJob*> m_resourceToJob; 102 85 QMap<QtJob*, ResourceHandle*> m_jobToResource; 86 #endif 103 87 104 88 FrameQtClient* m_frameClient; 105 89 }; 106 90 107 #endif108 109 91 } 110 92 -
trunk/WebKitQt/ChangeLog
r17553 r17567 1 2006-11-03 Zack Rusin <zack@kde.org> 2 3 Reviewed by Maciej. 4 5 Fixing compile on both Qt and KDE platforms. 6 7 * QtLauncher/main.cpp: 8 (main): url has already been defined 9 * WebKitPart/WebKitPartBrowserExtension.cpp: removing 10 duplicate implementation of this class 11 1 12 2006-10-31 Simon Hausmann <hausmann@kde.org> 2 13 -
trunk/WebKitQt/QtLauncher/main.cpp
r17553 r17567 66 66 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); 67 67 68 QString url;69 70 68 if (args->count() != 0) 71 69 url = args->arg(0); 72 73 70 #else 74 71 QApplication app(argc, argv); … … 77 74 if (args.count() > 1) 78 75 url = args.at(1); 79 80 76 #endif 81 77 -
trunk/WebKitQt/WebKitPart/WebKitPartBrowserExtension.cpp
r17553 r17567 39 39 40 40 // vim: ts=4 sw=4 et 41 /*42 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>43 *44 * All rights reserved.45 *46 * Redistribution and use in source and binary forms, with or without47 * modification, are permitted provided that the following conditions48 * are met:49 * 1. Redistributions of source code must retain the above copyright50 * notice, this list of conditions and the following disclaimer.51 * 2. Redistributions in binary form must reproduce the above copyright52 * notice, this list of conditions and the following disclaimer in the53 * documentation and/or other materials provided with the distribution.54 *55 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY56 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE57 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR58 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR59 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,60 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,61 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR62 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY63 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT64 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE65 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.66 */67 68 #include "config.h"69 #include "WebKitPartBrowserExtension.h"70 71 WebKitPartBrowserExtension::WebKitPartBrowserExtension(KParts::ReadOnlyPart* part)72 : KParts::BrowserExtension(part)73 {74 }75 76 WebKitPartBrowserExtension::~WebKitPartBrowserExtension()77 {78 }79 80 // vim: ts=4 sw=4 et
Note: See TracChangeset
for help on using the changeset viewer.