Results 1 to 9 of 9

Thread: How to enable the offline storage feature?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to enable the offline storage feature?

    Not work either.Is anything missing?
    I compile qt for x11 with configure -debug.
    Last edited by djstava; 30th January 2011 at 13:37.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to enable the offline storage feature?

    Can you please respond in full sentences and with context?
    Otherwise it will be very hard for people to understand you.

    What didn't work either?
    Why do you think anything is missing?
    What does compiling Qt with the -debug flag have to do with this?

    I don't know where this path comes from, but most likely, you can not write to it from a normal user account.

  3. #3
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to enable the offline storage feature?

    Quote Originally Posted by tbscope View Post
    Can you please respond in full sentences and with context?
    Otherwise it will be very hard for people to understand you.

    What didn't work either?
    Why do you think anything is missing?
    What does compiling Qt with the -debug flag have to do with this?

    I don't know where this path comes from, but most likely, you can not write to it from a normal user account.
    Sorry for that.
    I login as root,so have the privillege to write the path /root/offline,and after I set this
    in BrowserApplication::loadSettings()
    Qt Code:
    1. defaultSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled,true); defaultSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled,true);
    2. defaultSettings->setAttribute(QWebSettings::LocalStorageEnabled,true);
    3. defaultSettings->setOfflineStoragePath("/home/offline");
    4. defaultSettings->setOfflineWebApplicationCachePath("/home/offline");
    5. defaultSettings->setLocalStoragePath("/home/offline");
    6. defaultSettings->setOfflineStorageDefaultQuota(5*1024*1024);
    7. defaultSettings->setOfflineWebApplicationCacheQuota(5*1024*1024);
    To copy to clipboard, switch view to plain text mode 
    There is a db file named ApplicationCache.db in the dir /home/offline.that may mean offlineWebApplicationCache works,am I right?
    I setup apache tomcat6.0,and use the chrome to test html5 cache,it's ok.According to the QT Reference Document QWebSettings Class,it should also support.
    I want to know whether what I've done is right?Thank you.

  4. #4
    Join Date
    Jan 2011
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to enable the offline storage feature?

    It seems demobrowser can not use web application cache when it restarts.

  5. #5

    Default Re: How to enable the offline storage feature?

    I've got the offline storage working after I made:

    webView->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
    webView->settings()->enablePersistentStorage(QDir::homePath());

    Other settings (setOfflineStorageDefaultQuota e.t.c.) seem to be optional.
    (one may want to change homePath to something better )

  6. #6
    Join Date
    Mar 2013
    Posts
    4
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to enable the offline storage feature?

    Hi,
    I am trying to enable application cache(offline webstorage) by just with the following api settings()->enablePersistentStorage("C:\\dd\\");
    With this api,I should see LocalStorage and ApplicationStorage folders in C:\dd .But I am seeing only LocalStorage folder in the C:\dd.

    I have even tried with the below code
    settings()->enablePersistentStorage("C:\\dd\\");
    settings()->setOfflineWebApplicationCachePath("C:\\dd\\AppCac he");
    I dont see any AppCache folder in C:\dd directory

    Can anyone help me what has gone wrong ...

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to enable the offline storage feature?

    Maybe it gets created on the first use.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Offline flash video
    By iUser59 in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 14:17
  2. Storage and View -> imageViewer
    By C167 in forum Qt Programming
    Replies: 15
    Last Post: 22nd January 2008, 14:43
  3. blocks, storage and objects
    By mickey in forum General Programming
    Replies: 6
    Last Post: 6th December 2007, 17:55
  4. What is the format of QByteArray's storage?
    By LiCodeX in forum Newbie
    Replies: 4
    Last Post: 31st October 2007, 09:21
  5. Work offline and Archive web page in Konqueror
    By jamadagni in forum KDE Forum
    Replies: 0
    Last Post: 22nd February 2006, 09:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.