Changeset 17567 in webkit


Ignore:
Timestamp:
Nov 3, 2006 2:48:15 AM (17 years ago)
Author:
staikos
Message:

2006-11-03 Zack Rusin <zack@kde.org>

Reviewed by Maciej, landed by George.

Compile on both KDE and Qt platforms

  • CMakeLists.txt: add zlib explicitly
  • platform/network/qt/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::self): (WebCore::QtJob::QtJob): (WebCore::QtJob::timerEvent): Integrate both implementations

so that moc can parse it

(WebCore::ResourceHandleManager::deliverJobData):
(WebCore::ResourceHandleManager::remove):

  • platform/network/qt/ResourceHandleManager.h:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/CMakeLists.txt

    r17552 r17567  
    12081208  kjs-unity
    12091209  pcre-unity
     1210  z
    12101211)
    12111212ELSE (WEBKIT_USE_KDE_SUPPORT)
     
    12191220  kjs-unity
    12201221  pcre-unity
     1222  z
    12211223)
    12221224ENDIF (WEBKIT_USE_KDE_SUPPORT)
  • trunk/WebCore/ChangeLog

    r17565 r17567  
     12006-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
    1172006-11-03  Maciej Stachowiak  <mjs@apple.com>
    218
  • trunk/WebCore/platform/network/qt/ResourceHandleManager.cpp

    r17552 r17567  
    2323 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2424 * (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.
    2626 */
    2727
     
    4343static ResourceHandleManager* s_self = 0;
    4444
     45
     46ResourceHandleManager* ResourceHandleManager::self()
     47{
     48    if (!s_self)
     49        s_self = new ResourceHandleManager();
     50
     51    return s_self;
     52}
     53
     54QtJob::QtJob(const QString& path)
     55    : m_path(path)
     56{
     57    startTimer(0);
     58}
     59
     60void 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}
    4575#if PLATFORM(KDE)
    4676
     
    5686}
    5787
    58 ResourceHandleManager* ResourceHandleManager::self()
    59 {
    60     if (!s_self)
    61         s_self = new ResourceHandleManager();
    62 
    63     return s_self;
    64 }
    65 
     88
     89void ResourceHandleManager::deliverJobData(QtJob*, const QByteArray&)
     90{
     91
     92}
    6693void ResourceHandleManager::slotData(KIO::Job* kioJob, const QByteArray& data)
    6794{
     
    149176        // otherwhise assembleResponseHeaders() is called too early...
    150177        RefPtr<PlatformResponseQt> response(new PlatformResponseQt());
    151         response->data = headers;   
     178        response->data = headers;
    152179        response->url = job->url().url();
    153180
     
    200227}
    201228
     229// Qt Resource Handle Manager
    202230#else
    203 // Qt Resource Handle Manager
    204 
    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 
    227231ResourceHandleManager::ResourceHandleManager()
    228232    : m_frameClient(0)
     
    234238}
    235239
    236 ResourceHandleManager* ResourceHandleManager::self()
    237 {
    238     if (!s_self)
    239         s_self = new ResourceHandleManager();
    240 
    241     return s_self;
    242 }
    243240
    244241void ResourceHandleManager::remove(ResourceHandle* job)
  • trunk/WebCore/platform/network/qt/ResourceHandleManager.h

    r17552 r17567  
    3838class FrameQtClient;
    3939
    40 #if PLATFORM(KDE)
    41 class ResourceHandleManager : public QObject {
    42 Q_OBJECT
    43 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*);
    5340   
    54 private:
    55     ResourceHandleManager();
    56     ~ResourceHandleManager();
    57 
    58     void remove(ResourceHandle*);
    59 
    60     // KIO Job <-> WebKit Job mapping
    61     QMap<ResourceHandle*, KIO::Job*> m_jobToKioMap;
    62     QMap<KIO::Job*, ResourceHandle*> m_kioToJobMap;
    63 
    64     FrameQtClient* m_frameClient;
    65 };
    66 #else
    67 
    6841class QtJob : public QObject
    6942{
     
    8255};
    8356
    84 class ResourceHandleManager : public QObject {
    85 Q_OBJECT
     57class ResourceHandleManager : public QObject
     58{
     59    Q_OBJECT
    8660public:
    8761    static ResourceHandleManager* self();
     
    9165
    9266public 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   
    9572private:
    9673    ResourceHandleManager();
     
    9976    void remove(ResourceHandle*);
    10077
     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   
    10184    QMap<ResourceHandle*, QtJob*> m_resourceToJob;
    10285    QMap<QtJob*, ResourceHandle*> m_jobToResource;
     86#endif
    10387
    10488    FrameQtClient* m_frameClient;
    10589};
    10690
    107 #endif
    108 
    10991}
    11092
  • trunk/WebKitQt/ChangeLog

    r17553 r17567  
     12006-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
    1122006-10-31  Simon Hausmann  <hausmann@kde.org>
    213
  • trunk/WebKitQt/QtLauncher/main.cpp

    r17553 r17567  
    6666    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    6767
    68     QString url;
    69 
    7068    if (args->count() != 0)
    7169        url = args->arg(0);
    72 
    7370#else
    7471    QApplication app(argc, argv);
     
    7774    if (args.count() > 1)
    7875        url = args.at(1);
    79 
    8076#endif
    8177     
  • trunk/WebKitQt/WebKitPart/WebKitPartBrowserExtension.cpp

    r17553 r17567  
    3939
    4040// 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 without
    47  * modification, are permitted provided that the following conditions
    48  * are met:
    49  * 1. Redistributions of source code must retain the above copyright
    50  *    notice, this list of conditions and the following disclaimer.
    51  * 2. Redistributions in binary form must reproduce the above copyright
    52  *    notice, this list of conditions and the following disclaimer in the
    53  *    documentation and/or other materials provided with the distribution.
    54  *
    55  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
    56  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    57  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    58  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
    59  * 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, OR
    62  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
    63  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    64  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    65  * 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.