Closed Bug 588186 Opened 12 years ago Closed 12 years ago

Remove permanent Debug output (qDebug) from widget related code

Categories

(Core Graveyard :: Widget: Qt, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: romaxa, Assigned: romaxa)

Details

Attachments

(1 file)

We have currently a lot of qDebug output in desktop build which is not ifdefed and available on release builds too.


I think we should replace it with logging API/NS_WARNINGS/ERRORS/CRITICALS...
Currently I see a lot of qDebug stuff in filepicker and clipboard code.. .we should fix that I think
Attached patch Temp fixSplinter Review
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #469468 - Flags: review?(mozilla)
Comment on attachment 469468 [details] [diff] [review]
Temp fix

>-        qDebug("No items to drag?");
>+        NS_WARNING("No items to drag?")

Please fix the missing semicolon

>diff --git a/widget/src/qt/nsFilePicker.cpp b/widget/src/qt/nsFilePicker.cpp
>--- a/widget/src/qt/nsFilePicker.cpp
>+++ b/widget/src/qt/nsFilePicker.cpp
>@@ -243,17 +248,19 @@ nsFilePicker::Show(PRInt16 *aReturn)
>         QStringList files = mDialog->selectedFiles();
>         QString selected;
>         if (!files.isEmpty())
>         {
>             selected = files[0];
>         }
> 
>         QString path = QFile::encodeName(selected);
>-        qDebug("path is '%s'", path.toAscii().data());
>+#ifdef PR_LOGGING
>+        PR_LOG(sFilePickerLog, PR_LOG_DEBUG, ("path is '%s'", path.toAscii().data()));
>+#endif

PR_LOG does not need wrapping into PR_LOGGING. I recommend to remove the #ifdef

>@@ -274,17 +281,19 @@ nsFilePicker::Show(PRInt16 *aReturn)
>     }
> 
> 
>     return NS_OK;
> }
> 
> void nsFilePicker::InitNative(nsIWidget *parent, const nsAString &title, PRInt16 mode)
> {
>-    qDebug("nsFilePicker::InitNative()");
>+#ifdef PR_LOGGING
>+        PR_LOG(sFilePickerLog, PR_LOG_DEBUG, ("nsFilePicker::InitNative"));
>+#endif

Same


r=me if above nits are fixed
Attachment #469468 - Flags: review?(mozilla) → review+
http://hg.mozilla.org/mozilla-central/rev/3a69086a2114
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.