Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 673894 | Differences between
and this patch

Collapse All | Expand All

(-)/dev/null (+11 lines)
Line 0 Link Here
1
Parent: e4ab3c16 (windeployqt: Simplify enabled/disabled modules option parsing)
2
Author: Jarek Kobus <jaroslaw.kobus@qt.io>
3
AuthorDate: 2018-12-18 12:51:38 +0100
4
Commit: Kai Koehne <kai.koehne@qt.io>
5
CommitDate: 2018-12-21 12:59:21 +0100
6
7
Bring the qcollectiongenerator tool back
8
9
Deprecate it now and redirect it to qhelpgenerator.
10
11
Change-Id: Iffda5c34c3d6833859c0fb155b52e8b42af02b1c
(-)a/src/assistant/assistant.pro.ORIG (-1 / +3 lines)
Lines 4-10 Link Here
4
SUBDIRS += \
4
SUBDIRS += \
5
           help \
5
           help \
6
           assistant \
6
           assistant \
7
           qhelpgenerator
7
           qhelpgenerator \
8
           qcollectiongenerator
8
9
9
assistant.depends = help
10
assistant.depends = help
10
qhelpgenerator.depends = help
11
qhelpgenerator.depends = help
Lines 12-15 Link Here
12
qtNomakeTools( \
13
qtNomakeTools( \
13
    assistant \
14
    assistant \
14
    qhelpgenerator \
15
    qhelpgenerator \
16
    qcollectiongenerator \
15
)
17
)
(-)a/src/assistant/help/Qt5HelpConfigExtras.cmake.in.ORIG (-2 / +136 lines)
Lines 1-4 Link Here
1
1
2
if (NOT TARGET Qt5::qcollectiongenerator)
3
 add_executable(Qt5::qcollectiongenerator IMPORTED)
4
5
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
6
 set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
7
!!ELSE
8
 set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
9
!!ENDIF
10
 _qt5_Help_check_file_exists(${imported_location})
11
12
 set_target_properties(Qt5::qcollectiongenerator PROPERTIES
13
 IMPORTED_LOCATION ${imported_location}
14
 )
15
endif()
16
2
if (NOT TARGET Qt5::qhelpgenerator)
17
if (NOT TARGET Qt5::qhelpgenerator)
3
    add_executable(Qt5::qhelpgenerator IMPORTED)
18
    add_executable(Qt5::qhelpgenerator IMPORTED)
4
19
5
-- /dev/null
20
++ b/src/assistant/qcollectiongenerator/main.c
Line 0 Link Here
0
-- /dev/null
1
/****************************************************************************
2
**
3
** Copyright (C) 2018 The Qt Company Ltd.
4
** Contact: https://www.qt.io/licensing/
5
**
6
** This file is part of the Qt Assistant of the Qt Toolkit.
7
**
8
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9
** Commercial License Usage
10
** Licensees holding valid commercial Qt licenses may use this file in
11
** accordance with the commercial license agreement provided with the
12
** Software or, alternatively, in accordance with the terms contained in
13
** a written agreement between you and The Qt Company. For licensing terms
14
** and conditions see https://www.qt.io/terms-conditions. For further
15
** information use the contact form at https://www.qt.io/contact-us.
16
**
17
** GNU General Public License Usage
18
** Alternatively, this file may be used under the terms of the GNU
19
** General Public License version 3 as published by the Free Software
20
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21
** included in the packaging of this file. Please review the following
22
** information to ensure the GNU General Public License requirements will
23
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24
**
25
** $QT_END_LICENSE$
26
**
27
****************************************************************************/
28
29
#include <stddef.h>
30
#include <stdio.h>
31
#include <stdlib.h>
32
#include <string.h>
33
34
#ifdef _WIN32
35
#include <process.h>
36
#else
37
#include <unistd.h>
38
#endif
39
40
static const char collectionGeneratorName[] = "qcollectiongenerator";
41
static const char helpGeneratorName[] = "qhelpgenerator";
42
43
#ifdef _WIN32
44
static const char separator = '\\';
45
#else
46
static const char separator = '/';
47
#endif
48
49
int main(int argc, char *argv[])
50
{
51
 printf("The \"%s\" tool is deprecated, use \"%s\" instead.\n\n",
52
 collectionGeneratorName, helpGeneratorName);
53
54
 // Replace the "qcollectiongenerator" with "qhelpgenerator"
55
 // in passed argv[0], keeping the path.
56
57
 const size_t currentNameSize = strlen(argv[0]);
58
 const size_t collectionGeneratorNameSize = strlen(collectionGeneratorName);
59
 const ptrdiff_t maxPathOffset = currentNameSize - collectionGeneratorNameSize;
60
 ptrdiff_t pathOffset = maxPathOffset;
61
62
 if (maxPathOffset >= 0 && strchr(argv[0] + maxPathOffset, separator))
63
 pathOffset = -1; // Separator detected. Wrong filename.
64
65
 while (pathOffset >= 0) {
66
 const char *fileName = argv[0] + pathOffset;
67
68
 if (fileName[0] == separator) { // Separator detected. Wrong filename.
69
 pathOffset = -1;
70
 break;
71
 }
72
73
 if (!strncmp(fileName, collectionGeneratorName, collectionGeneratorNameSize))
74
 break;
75
76
 --pathOffset;
77
 }
78
79
 if (pathOffset < 0) {
80
 fprintf(stderr, "Wrong tool name. "
81
 "The tool name is expected to contain: \"%s\", got: \"%s\" instead.\n",
82
 collectionGeneratorName, argv[0]);
83
 return 3;
84
 }
85
86
 const size_t helpGeneratorNameSize = strlen(helpGeneratorName);
87
 // Allocate a buffer for the new full path, consisting of the pathSize + new name
88
 char *newPath = (char *) malloc((maxPathOffset + helpGeneratorNameSize + 1) * sizeof(char));
89
 // Copy the path
90
 memcpy(newPath, argv[0], pathOffset);
91
 // Copy the new name
92
 memcpy(newPath + pathOffset, helpGeneratorName, helpGeneratorNameSize);
93
 // Copy the remaining part
94
 memcpy(newPath + pathOffset + helpGeneratorNameSize,
95
 argv[0] + pathOffset + collectionGeneratorNameSize,
96
 currentNameSize - pathOffset - collectionGeneratorNameSize + 1);
97
98
 argv[0] = newPath;
99
#ifdef _WIN32
100
 const intptr_t ret = _spawnvp(_P_WAIT, newPath, argv);
101
 if (ret == -1) {
102
 fprintf(stderr, "Error while executing \"%s\" tool.\n", newPath);
103
 return 3;
104
 }
105
 return ret;
106
#else
107
 execvp(newPath, argv);
108
 fprintf(stderr, "Error while executing \"%s\" tool.\n", newPath);
109
 return 3;
110
#endif
111
}
112
113
++ b/src/assistant/qcollectiongenerator/qcollectiongenerator.pro
Line 0 Link Here
1
CONFIG += console
2
CONFIG -= qt app_bundle
3
SOURCES += main.c
4
5
QMAKE_TARGET_DESCRIPTION = "Qt Help Collection File Generator"
6
load(qt_tool)
7

Return to bug 673894