Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Quazip JlCompress::extractDir error

Quazip JlCompress::extractDir error

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 879 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    addebito
    wrote on last edited by
    #1

    Hi all,
    I must decompress a zip archive.
    I'm trying to use Quazip.
    To include the library, I've added these lines inside .pro file

    ###################### QUAZIP ######################
    INCLUDEPATH += $$PWD/libs/quazip-0.7.3/quazip
    INCLUDEPATH += $$PWD/libs/zlib-1.2.8
    win32 {
        LIBS += "$$PWD/libs/zlib-1.2.8/bin/win_x64/zlib.lib"
        LIBS += "$$PWD/libs/quazip-0.7.3/quazip/bin/win_x64/quazip.lib"
    }
    
    linux:!android {
        LIBS += -L$$PWD/libs/zlib-1.2.8/bin/linux_x64/ -lzlib
        LIBS += -L$$PWD/libs/quazip-0.7.3/quazip/bin/linux_x64/ -lquazip
    }
    

    I got an error when I call

    JlCompress::extractDir(zipSourceFile, output_path);
    

    The problem seems the deallocation of the returned QStringList.
    This is the error received...

    7b6cfbc7-a6e0-41be-acd1-ff6e93f92241-immagine.png

    If I press the "ignore" button I got this error.

    b50b1a94-2720-44b1-b717-383919f55492-immagine.png

    If I press the "ignore" button I got this error.

    45db3b92-e2a0-4970-9e83-970596676fb8-immagine.png
    ....and this is the code:

    void WindowRestart::unzipSourceFile(const QString &zipSourceFile)
    {
        qDebug() << "zipSourceFile:" << zipSourceFile;
        if (QFile::exists(zipSourceFile))
        {
            QFileInfo fileinfo(m_processFullPath);
            QString output_path = fileinfo.absolutePath() + "/../";
            qDebug() << "output_path" << output_path;
            if (!QFileInfo::exists(output_path))
            {
                QDir dir;
                dir.mkpath(output_path);
            }
    
            JlCompress::extractDir(zipSourceFile, output_path);  // <--- ERROR WHEN I EXECUTE THIS LINE
    
            //        QStringList zip_files = JlCompress::extractDir(zipSourceFile, output_path);
            //        if (zip_files.isEmpty())
            //        {
            //            QMessageBox::critical(this, "Error extracting the project",
            //                                  QString("Impossible to open the the file\n\nProbably you are attemping to extract a corrupted zip file"),
            //                                  QMessageBox::Close);
            //        }
        }
    }
    

    The files are correctly extracted.
    I'm using QT 5.14.2 under Windows 10.

    Thank you for every suggestions.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alvazz
      wrote on last edited by
      #2

      I also encountered the same problem, did you solve it in the end?

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Don't mix debug and release libraries.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved